!function(a, b) {
    "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function(a) {
        if (!a.document)
            throw new Error("jQuery requires a window with a document");
        return b(a)
    }
        : b(a)
}("undefined" != typeof window ? window : this, function(a, b) {
    var c = []
        , d = c.slice
        , e = c.concat
        , f = c.push
        , g = c.indexOf
        , h = {}
        , i = h.toString
        , j = h.hasOwnProperty
        , k = {}
        , l = "1.11.2"
        , m = function(a, b) {
            return new m.fn.init(a,b)
        }
        , n = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g
        , o = /^-ms-/
        , p = /-([\da-z])/gi
        , q = function(a, b) {
            return b.toUpperCase()
        };
    m.fn = m.prototype = {
        jquery: l,
        constructor: m,
        selector: "",
        length: 0,
        toArray: function() {
            return d.call(this)
        },
        get: function(a) {
            return null != a ? 0 > a ? this[a + this.length] : this[a] : d.call(this)
        },
        pushStack: function(a) {
            var b = m.merge(this.constructor(), a);
            return b.prevObject = this,
                b.context = this.context,
                b
        },
        each: function(a, b) {
            return m.each(this, a, b)
        },
        map: function(a) {
            return this.pushStack(m.map(this, function(b, c) {
                return a.call(b, c, b)
            }))
        },
        slice: function() {
            return this.pushStack(d.apply(this, arguments))
        },
        first: function() {
            return this.eq(0)
        },
        last: function() {
            return this.eq(-1)
        },
        eq: function(a) {
            var b = this.length
                , c = +a + (0 > a ? b : 0);
            return this.pushStack(c >= 0 && b > c ? [this[c]] : [])
        },
        end: function() {
            return this.prevObject || this.constructor(null)
        },
        push: f,
        sort: c.sort,
        splice: c.splice
    },
        m.extend = m.fn.extend = function() {
            var a, b, c, d, e, f, g = arguments[0] || {}, h = 1, i = arguments.length, j = !1;
            for ("boolean" == typeof g && (j = g,
                g = arguments[h] || {},
                h++),
                     "object" == typeof g || m.isFunction(g) || (g = {}),
                     h === i && (g = this,
                     h--); i > h; h++)
                if (null != (e = arguments[h]))
                    for (d in e)
                        a = g[d],
                            c = e[d],
                            g !== c && (j && c && (m.isPlainObject(c) || (b = m.isArray(c))) ? (b ? (b = !1,
                            f = a && m.isArray(a) ? a : []) : f = a && m.isPlainObject(a) ? a : {},
                            g[d] = m.extend(j, f, c)) : void 0 !== c && (g[d] = c));
            return g
        }
        ,
        m.extend({
            expando: "jQuery" + (l + Math.random()).replace(/\D/g, ""),
            isReady: !0,
            error: function(a) {
                throw new Error(a)
            },
            noop: function() {},
            isFunction: function(a) {
                return "function" === m.type(a)
            },
            isArray: Array.isArray || function(a) {
                return "array" === m.type(a)
            }
            ,
            isWindow: function(a) {
                return null != a && a == a.window
            },
            isNumeric: function(a) {
                return !m.isArray(a) && a - parseFloat(a) + 1 >= 0
            },
            isEmptyObject: function(a) {
                var b;
                for (b in a)
                    return !1;
                return !0
            },
            isPlainObject: function(a) {
                var b;
                if (!a || "object" !== m.type(a) || a.nodeType || m.isWindow(a))
                    return !1;
                try {
                    if (a.constructor && !j.call(a, "constructor") && !j.call(a.constructor.prototype, "isPrototypeOf"))
                        return !1
                } catch (c) {
                    return !1
                }
                if (k.ownLast)
                    for (b in a)
                        return j.call(a, b);
                for (b in a)
                    ;
                return void 0 === b || j.call(a, b)
            },
            type: function(a) {
                return null == a ? a + "" : "object" == typeof a || "function" == typeof a ? h[i.call(a)] || "object" : typeof a
            },
            globalEval: function(b) {
                b && m.trim(b) && (a.execScript || function(b) {
                    a.eval.call(a, b)
                }
                    )(b)
            },
            camelCase: function(a) {
                return a.replace(o, "ms-").replace(p, q)
            },
            nodeName: function(a, b) {
                return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase()
            },
            each: function(a, b, c) {
                var d, e = 0, f = a.length, g = r(a);
                if (c) {
                    if (g) {
                        for (; f > e; e++)
                            if (d = b.apply(a[e], c),
                                d === !1)
                                break
                    } else
                        for (e in a)
                            if (d = b.apply(a[e], c),
                                d === !1)
                                break
                } else if (g) {
                    for (; f > e; e++)
                        if (d = b.call(a[e], e, a[e]),
                            d === !1)
                            break
                } else
                    for (e in a)
                        if (d = b.call(a[e], e, a[e]),
                            d === !1)
                            break;
                return a
            },
            trim: function(a) {
                return null == a ? "" : (a + "").replace(n, "")
            },
            makeArray: function(a, b) {
                var c = b || [];
                return null != a && (r(Object(a)) ? m.merge(c, "string" == typeof a ? [a] : a) : f.call(c, a)),
                    c
            },
            inArray: function(a, b, c) {
                var d;
                if (b) {
                    if (g)
                        return g.call(b, a, c);
                    for (d = b.length,
                             c = c ? 0 > c ? Math.max(0, d + c) : c : 0; d > c; c++)
                        if (c in b && b[c] === a)
                            return c
                }
                return -1
            },
            merge: function(a, b) {
                var c = +b.length
                    , d = 0
                    , e = a.length;
                while (c > d)
                    a[e++] = b[d++];
                if (c !== c)
                    while (void 0 !== b[d])
                        a[e++] = b[d++];
                return a.length = e,
                    a
            },
            grep: function(a, b, c) {
                for (var d, e = [], f = 0, g = a.length, h = !c; g > f; f++)
                    d = !b(a[f], f),
                        d !== h && e.push(a[f]);
                return e
            },
            map: function(a, b, c) {
                var d, f = 0, g = a.length, h = r(a), i = [];
                if (h)
                    for (; g > f; f++)
                        d = b(a[f], f, c),
                            null != d && i.push(d);
                else
                    for (f in a)
                        d = b(a[f], f, c),
                            null != d && i.push(d);
                return e.apply([], i)
            },
            guid: 1,
            proxy: function(a, b) {
                var c, e, f;
                return "string" == typeof b && (f = a[b],
                    b = a,
                    a = f),
                    m.isFunction(a) ? (c = d.call(arguments, 2),
                        e = function() {
                            return a.apply(b || this, c.concat(d.call(arguments)))
                        }
                        ,
                        e.guid = a.guid = a.guid || m.guid++,
                        e) : void 0
            },
            now: function() {
                return +new Date
            },
            support: k
        }),
        m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(a, b) {
            h["[object " + b + "]"] = b.toLowerCase()
        });
    function r(a) {
        var b = a.length
            , c = m.type(a);
        return "function" === c || m.isWindow(a) ? !1 : 1 === a.nodeType && b ? !0 : "array" === c || 0 === b || "number" == typeof b && b > 0 && b - 1 in a
    }
    var s = function(a) {
        var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u = "sizzle" + 1 * new Date, v = a.document, w = 0, x = 0, y = hb(), z = hb(), A = hb(), B = function(a, b) {
            return a === b && (l = !0),
                0
        }, C = 1 << 31, D = {}.hasOwnProperty, E = [], F = E.pop, G = E.push, H = E.push, I = E.slice, J = function(a, b) {
            for (var c = 0, d = a.length; d > c; c++)
                if (a[c] === b)
                    return c;
            return -1
        }, K = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", L = "[\\x20\\t\\r\\n\\f]", M = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", N = M.replace("w", "w#"), O = "\\[" + L + "*(" + M + ")(?:" + L + "*([*^$|!~]?=)" + L + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + N + "))|)" + L + "*\\]", P = ":(" + M + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + O + ")*)|.*)\\)|)", Q = new RegExp(L + "+","g"), R = new RegExp("^" + L + "+|((?:^|[^\\\\])(?:\\\\.)*)" + L + "+$","g"), S = new RegExp("^" + L + "*," + L + "*"), T = new RegExp("^" + L + "*([>+~]|" + L + ")" + L + "*"), U = new RegExp("=" + L + "*([^\\]'\"]*?)" + L + "*\\]","g"), V = new RegExp(P), W = new RegExp("^" + N + "$"), X = {
            ID: new RegExp("^#(" + M + ")"),
            CLASS: new RegExp("^\\.(" + M + ")"),
            TAG: new RegExp("^(" + M.replace("w", "w*") + ")"),
            ATTR: new RegExp("^" + O),
            PSEUDO: new RegExp("^" + P),
            CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + L + "*(even|odd|(([+-]|)(\\d*)n|)" + L + "*(?:([+-]|)" + L + "*(\\d+)|))" + L + "*\\)|)","i"),
            bool: new RegExp("^(?:" + K + ")$","i"),
            needsContext: new RegExp("^" + L + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + L + "*((?:-\\d)?\\d*)" + L + "*\\)|)(?=[^-]|$)","i")
        }, Y = /^(?:input|select|textarea|button)$/i, Z = /^h\d$/i, $ = /^[^{]+\{\s*\[native \w/, _ = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, ab = /[+~]/, bb = /'|\\/g, cb = new RegExp("\\\\([\\da-f]{1,6}" + L + "?|(" + L + ")|.)","ig"), db = function(a, b, c) {
            var d = "0x" + b - 65536;
            return d !== d || c ? b : 0 > d ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320)
        }, eb = function() {
            m()
        };
        try {
            H.apply(E = I.call(v.childNodes), v.childNodes),
                E[v.childNodes.length].nodeType
        } catch (fb) {
            H = {
                apply: E.length ? function(a, b) {
                    G.apply(a, I.call(b))
                }
                    : function(a, b) {
                    var c = a.length
                        , d = 0;
                    while (a[c++] = b[d++])
                        ;
                    a.length = c - 1
                }
            }
        }
        function gb(a, b, d, e) {
            var f, h, j, k, l, o, r, s, w, x;
            if ((b ? b.ownerDocument || b : v) !== n && m(b),
                b = b || n,
                d = d || [],
                k = b.nodeType,
                "string" != typeof a || !a || 1 !== k && 9 !== k && 11 !== k)
                return d;
            if (!e && p) {
                if (11 !== k && (f = _.exec(a)))
                    if (j = f[1]) {
                        if (9 === k) {
                            if (h = b.getElementById(j),
                                !h || !h.parentNode)
                                return d;
                            if (h.id === j)
                                return d.push(h),
                                    d
                        } else if (b.ownerDocument && (h = b.ownerDocument.getElementById(j)) && t(b, h) && h.id === j)
                            return d.push(h),
                                d
                    } else {
                        if (f[2])
                            return H.apply(d, b.getElementsByTagName(a)),
                                d;
                        if ((j = f[3]) && c.getElementsByClassName)
                            return H.apply(d, b.getElementsByClassName(j)),
                                d
                    }
                if (c.qsa && (!q || !q.test(a))) {
                    if (s = r = u,
                        w = b,
                        x = 1 !== k && a,
                        1 === k && "object" !== b.nodeName.toLowerCase()) {
                        o = g(a),
                            (r = b.getAttribute("id")) ? s = r.replace(bb, "\\$&") : b.setAttribute("id", s),
                            s = "[id='" + s + "'] ",
                            l = o.length;
                        while (l--)
                            o[l] = s + rb(o[l]);
                        w = ab.test(a) && pb(b.parentNode) || b,
                            x = o.join(",")
                    }
                    if (x)
                        try {
                            return H.apply(d, w.querySelectorAll(x)),
                                d
                        } catch (y) {} finally {
                            r || b.removeAttribute("id")
                        }
                }
            }
            return i(a.replace(R, "$1"), b, d, e)
        }
        function hb() {
            var a = [];
            function b(c, e) {
                return a.push(c + " ") > d.cacheLength && delete b[a.shift()],
                    b[c + " "] = e
            }
            return b
        }
        function ib(a) {
            return a[u] = !0,
                a
        }
        function jb(a) {
            var b = n.createElement("div");
            try {
                return !!a(b)
            } catch (c) {
                return !1
            } finally {
                b.parentNode && b.parentNode.removeChild(b),
                    b = null
            }
        }
        function kb(a, b) {
            var c = a.split("|")
                , e = a.length;
            while (e--)
                d.attrHandle[c[e]] = b
        }
        function lb(a, b) {
            var c = b && a
                , d = c && 1 === a.nodeType && 1 === b.nodeType && (~b.sourceIndex || C) - (~a.sourceIndex || C);
            if (d)
                return d;
            if (c)
                while (c = c.nextSibling)
                    if (c === b)
                        return -1;
            return a ? 1 : -1
        }
        function mb(a) {
            return function(b) {
                var c = b.nodeName.toLowerCase();
                return "input" === c && b.type === a
            }
        }
        function nb(a) {
            return function(b) {
                var c = b.nodeName.toLowerCase();
                return ("input" === c || "button" === c) && b.type === a
            }
        }
        function ob(a) {
            return ib(function(b) {
                return b = +b,
                    ib(function(c, d) {
                        var e, f = a([], c.length, b), g = f.length;
                        while (g--)
                            c[e = f[g]] && (c[e] = !(d[e] = c[e]))
                    })
            })
        }
        function pb(a) {
            return a && "undefined" != typeof a.getElementsByTagName && a
        }
        c = gb.support = {},
            f = gb.isXML = function(a) {
                var b = a && (a.ownerDocument || a).documentElement;
                return b ? "HTML" !== b.nodeName : !1
            }
            ,
            m = gb.setDocument = function(a) {
                var b, e, g = a ? a.ownerDocument || a : v;
                return g !== n && 9 === g.nodeType && g.documentElement ? (n = g,
                    o = g.documentElement,
                    e = g.defaultView,
                    e && e !== e.top && (e.addEventListener ? e.addEventListener("unload", eb, !1) : e.attachEvent && e.attachEvent("onunload", eb)),
                    p = !f(g),
                    c.attributes = jb(function(a) {
                        return a.className = "i",
                            !a.getAttribute("className")
                    }),
                    c.getElementsByTagName = jb(function(a) {
                        return a.appendChild(g.createComment("")),
                            !a.getElementsByTagName("*").length
                    }),
                    c.getElementsByClassName = $.test(g.getElementsByClassName),
                    c.getById = jb(function(a) {
                        return o.appendChild(a).id = u,
                            !g.getElementsByName || !g.getElementsByName(u).length
                    }),
                    c.getById ? (d.find.ID = function(a, b) {
                        if ("undefined" != typeof b.getElementById && p) {
                            var c = b.getElementById(a);
                            return c && c.parentNode ? [c] : []
                        }
                    }
                        ,
                        d.filter.ID = function(a) {
                            var b = a.replace(cb, db);
                            return function(a) {
                                return a.getAttribute("id") === b
                            }
                        }
                        ) : (delete d.find.ID,
                        d.filter.ID = function(a) {
                            var b = a.replace(cb, db);
                            return function(a) {
                                var c = "undefined" != typeof a.getAttributeNode && a.getAttributeNode("id");
                                return c && c.value === b
                            }
                        }
                        ),
                    d.find.TAG = c.getElementsByTagName ? function(a, b) {
                        return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName(a) : c.qsa ? b.querySelectorAll(a) : void 0
                    }
                        : function(a, b) {
                        var c, d = [], e = 0, f = b.getElementsByTagName(a);
                        if ("*" === a) {
                            while (c = f[e++])
                                1 === c.nodeType && d.push(c);
                            return d
                        }
                        return f
                    }
                    ,
                    d.find.CLASS = c.getElementsByClassName && function(a, b) {
                        return p ? b.getElementsByClassName(a) : void 0
                    }
                    ,
                    r = [],
                    q = [],
                    (c.qsa = $.test(g.querySelectorAll)) && (jb(function(a) {
                    o.appendChild(a).innerHTML = "<a id='" + u + "'></a><select id='" + u + "-\f]' msallowcapture=''><option selected=''></option></select>",
                        a.querySelectorAll("[msallowcapture^='']").length && q.push("[*^$]=" + L + "*(?:''|\"\")"),
                        a.querySelectorAll("[selected]").length || q.push("\\[" + L + "*(?:value|" + K + ")"),
                        a.querySelectorAll("[id~=" + u + "-]").length || q.push("~="),
                        a.querySelectorAll(":checked").length || q.push(":checked"),
                        a.querySelectorAll("a#" + u + "+*").length || q.push(".#.+[+~]")
                }),
                    jb(function(a) {
                        var b = g.createElement("input");
                        b.setAttribute("type", "hidden"),
                            a.appendChild(b).setAttribute("name", "D"),
                            a.querySelectorAll("[name=d]").length && q.push("name" + L + "*[*^$|!~]?="),
                            a.querySelectorAll(":enabled").length || q.push(":enabled", ":disabled"),
                            a.querySelectorAll("*,:x"),
                            q.push(",.*:")
                    })),
                    (c.matchesSelector = $.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) && jb(function(a) {
                    c.disconnectedMatch = s.call(a, "div"),
                        s.call(a, "[s!='']:x"),
                        r.push("!=", P)
                }),
                    q = q.length && new RegExp(q.join("|")),
                    r = r.length && new RegExp(r.join("|")),
                    b = $.test(o.compareDocumentPosition),
                    t = b || $.test(o.contains) ? function(a, b) {
                        var c = 9 === a.nodeType ? a.documentElement : a
                            , d = b && b.parentNode;
                        return a === d || !(!d || 1 !== d.nodeType || !(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d)))
                    }
                        : function(a, b) {
                        if (b)
                            while (b = b.parentNode)
                                if (b === a)
                                    return !0;
                        return !1
                    }
                    ,
                    B = b ? function(a, b) {
                        if (a === b)
                            return l = !0,
                                0;
                        var d = !a.compareDocumentPosition - !b.compareDocumentPosition;
                        return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1,
                                1 & d || !c.sortDetached && b.compareDocumentPosition(a) === d ? a === g || a.ownerDocument === v && t(v, a) ? -1 : b === g || b.ownerDocument === v && t(v, b) ? 1 : k ? J(k, a) - J(k, b) : 0 : 4 & d ? -1 : 1)
                    }
                        : function(a, b) {
                        if (a === b)
                            return l = !0,
                                0;
                        var c, d = 0, e = a.parentNode, f = b.parentNode, h = [a], i = [b];
                        if (!e || !f)
                            return a === g ? -1 : b === g ? 1 : e ? -1 : f ? 1 : k ? J(k, a) - J(k, b) : 0;
                        if (e === f)
                            return lb(a, b);
                        c = a;
                        while (c = c.parentNode)
                            h.unshift(c);
                        c = b;
                        while (c = c.parentNode)
                            i.unshift(c);
                        while (h[d] === i[d])
                            d++;
                        return d ? lb(h[d], i[d]) : h[d] === v ? -1 : i[d] === v ? 1 : 0
                    }
                    ,
                    g) : n
            }
            ,
            gb.matches = function(a, b) {
                return gb(a, null, null, b)
            }
            ,
            gb.matchesSelector = function(a, b) {
                if ((a.ownerDocument || a) !== n && m(a),
                    b = b.replace(U, "='$1']"),
                    !(!c.matchesSelector || !p || r && r.test(b) || q && q.test(b)))
                    try {
                        var d = s.call(a, b);
                        if (d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType)
                            return d
                    } catch (e) {}
                return gb(b, n, null, [a]).length > 0
            }
            ,
            gb.contains = function(a, b) {
                return (a.ownerDocument || a) !== n && m(a),
                    t(a, b)
            }
            ,
            gb.attr = function(a, b) {
                (a.ownerDocument || a) !== n && m(a);
                var e = d.attrHandle[b.toLowerCase()]
                    , f = e && D.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : void 0;
                return void 0 !== f ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null
            }
            ,
            gb.error = function(a) {
                throw new Error("Syntax error, unrecognized expression: " + a)
            }
            ,
            gb.uniqueSort = function(a) {
                var b, d = [], e = 0, f = 0;
                if (l = !c.detectDuplicates,
                    k = !c.sortStable && a.slice(0),
                    a.sort(B),
                    l) {
                    while (b = a[f++])
                        b === a[f] && (e = d.push(f));
                    while (e--)
                        a.splice(d[e], 1)
                }
                return k = null,
                    a
            }
            ,
            e = gb.getText = function(a) {
                var b, c = "", d = 0, f = a.nodeType;
                if (f) {
                    if (1 === f || 9 === f || 11 === f) {
                        if ("string" == typeof a.textContent)
                            return a.textContent;
                        for (a = a.firstChild; a; a = a.nextSibling)
                            c += e(a)
                    } else if (3 === f || 4 === f)
                        return a.nodeValue
                } else
                    while (b = a[d++])
                        c += e(b);
                return c
            }
            ,
            d = gb.selectors = {
                cacheLength: 50,
                createPseudo: ib,
                match: X,
                attrHandle: {},
                find: {},
                relative: {
                    ">": {
                        dir: "parentNode",
                        first: !0
                    },
                    " ": {
                        dir: "parentNode"
                    },
                    "+": {
                        dir: "previousSibling",
                        first: !0
                    },
                    "~": {
                        dir: "previousSibling"
                    }
                },
                preFilter: {
                    ATTR: function(a) {
                        return a[1] = a[1].replace(cb, db),
                            a[3] = (a[3] || a[4] || a[5] || "").replace(cb, db),
                            "~=" === a[2] && (a[3] = " " + a[3] + " "),
                            a.slice(0, 4)
                    },
                    CHILD: function(a) {
                        return a[1] = a[1].toLowerCase(),
                                "nth" === a[1].slice(0, 3) ? (a[3] || gb.error(a[0]),
                            a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])),
                            a[5] = +(a[7] + a[8] || "odd" === a[3])) : a[3] && gb.error(a[0]),
                            a
                    },
                    PSEUDO: function(a) {
                        var b, c = !a[6] && a[2];
                        return X.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[4] || a[5] || "" : c && V.test(c) && (b = g(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b),
                            a[2] = c.slice(0, b)),
                            a.slice(0, 3))
                    }
                },
                filter: {
                    TAG: function(a) {
                        var b = a.replace(cb, db).toLowerCase();
                        return "*" === a ? function() {
                            return !0
                        }
                            : function(a) {
                            return a.nodeName && a.nodeName.toLowerCase() === b
                        }
                    },
                    CLASS: function(a) {
                        var b = y[a + " "];
                        return b || (b = new RegExp("(^|" + L + ")" + a + "(" + L + "|$)")) && y(a, function(a) {
                            return b.test("string" == typeof a.className && a.className || "undefined" != typeof a.getAttribute && a.getAttribute("class") || "")
                        })
                    },
                    ATTR: function(a, b, c) {
                        return function(d) {
                            var e = gb.attr(d, a);
                            return null == e ? "!=" === b : b ? (e += "",
                                    "=" === b ? e === c : "!=" === b ? e !== c : "^=" === b ? c && 0 === e.indexOf(c) : "*=" === b ? c && e.indexOf(c) > -1 : "$=" === b ? c && e.slice(-c.length) === c : "~=" === b ? (" " + e.replace(Q, " ") + " ").indexOf(c) > -1 : "|=" === b ? e === c || e.slice(0, c.length + 1) === c + "-" : !1) : !0
                        }
                    },
                    CHILD: function(a, b, c, d, e) {
                        var f = "nth" !== a.slice(0, 3)
                            , g = "last" !== a.slice(-4)
                            , h = "of-type" === b;
                        return 1 === d && 0 === e ? function(a) {
                            return !!a.parentNode
                        }
                            : function(b, c, i) {
                            var j, k, l, m, n, o, p = f !== g ? "nextSibling" : "previousSibling", q = b.parentNode, r = h && b.nodeName.toLowerCase(), s = !i && !h;
                            if (q) {
                                if (f) {
                                    while (p) {
                                        l = b;
                                        while (l = l[p])
                                            if (h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType)
                                                return !1;
                                        o = p = "only" === a && !o && "nextSibling"
                                    }
                                    return !0
                                }
                                if (o = [g ? q.firstChild : q.lastChild],
                                    g && s) {
                                    k = q[u] || (q[u] = {}),
                                        j = k[a] || [],
                                        n = j[0] === w && j[1],
                                        m = j[0] === w && j[2],
                                        l = n && q.childNodes[n];
                                    while (l = ++n && l && l[p] || (m = n = 0) || o.pop())
                                        if (1 === l.nodeType && ++m && l === b) {
                                            k[a] = [w, n, m];
                                            break
                                        }
                                } else if (s && (j = (b[u] || (b[u] = {}))[a]) && j[0] === w)
                                    m = j[1];
                                else
                                    while (l = ++n && l && l[p] || (m = n = 0) || o.pop())
                                        if ((h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType) && ++m && (s && ((l[u] || (l[u] = {}))[a] = [w, m]),
                                            l === b))
                                            break;
                                return m -= e,
                                    m === d || m % d === 0 && m / d >= 0
                            }
                        }
                    },
                    PSEUDO: function(a, b) {
                        var c, e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || gb.error("unsupported pseudo: " + a);
                        return e[u] ? e(b) : e.length > 1 ? (c = [a, a, "", b],
                            d.setFilters.hasOwnProperty(a.toLowerCase()) ? ib(function(a, c) {
                                var d, f = e(a, b), g = f.length;
                                while (g--)
                                    d = J(a, f[g]),
                                        a[d] = !(c[d] = f[g])
                            }) : function(a) {
                                return e(a, 0, c)
                            }
                            ) : e
                    }
                },
                pseudos: {
                    not: ib(function(a) {
                        var b = []
                            , c = []
                            , d = h(a.replace(R, "$1"));
                        return d[u] ? ib(function(a, b, c, e) {
                            var f, g = d(a, null, e, []), h = a.length;
                            while (h--)
                                (f = g[h]) && (a[h] = !(b[h] = f))
                        }) : function(a, e, f) {
                            return b[0] = a,
                                d(b, null, f, c),
                                b[0] = null,
                                !c.pop()
                        }
                    }),
                    has: ib(function(a) {
                        return function(b) {
                            return gb(a, b).length > 0
                        }
                    }),
                    contains: ib(function(a) {
                        return a = a.replace(cb, db),
                            function(b) {
                                return (b.textContent || b.innerText || e(b)).indexOf(a) > -1
                            }
                    }),
                    lang: ib(function(a) {
                        return W.test(a || "") || gb.error("unsupported lang: " + a),
                            a = a.replace(cb, db).toLowerCase(),
                            function(b) {
                                var c;
                                do
                                    if (c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang"))
                                        return c = c.toLowerCase(),
                                            c === a || 0 === c.indexOf(a + "-");
                                while ((b = b.parentNode) && 1 === b.nodeType);return !1
                            }
                    }),
                    target: function(b) {
                        var c = a.location && a.location.hash;
                        return c && c.slice(1) === b.id
                    },
                    root: function(a) {
                        return a === o
                    },
                    focus: function(a) {
                        return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex)
                    },
                    enabled: function(a) {
                        return a.disabled === !1
                    },
                    disabled: function(a) {
                        return a.disabled === !0
                    },
                    checked: function(a) {
                        var b = a.nodeName.toLowerCase();
                        return "input" === b && !!a.checked || "option" === b && !!a.selected
                    },
                    selected: function(a) {
                        return a.parentNode && a.parentNode.selectedIndex,
                            a.selected === !0
                    },
                    empty: function(a) {
                        for (a = a.firstChild; a; a = a.nextSibling)
                            if (a.nodeType < 6)
                                return !1;
                        return !0
                    },
                    parent: function(a) {
                        return !d.pseudos.empty(a)
                    },
                    header: function(a) {
                        return Z.test(a.nodeName)
                    },
                    input: function(a) {
                        return Y.test(a.nodeName)
                    },
                    button: function(a) {
                        var b = a.nodeName.toLowerCase();
                        return "input" === b && "button" === a.type || "button" === b
                    },
                    text: function(a) {
                        var b;
                        return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || "text" === b.toLowerCase())
                    },
                    first: ob(function() {
                        return [0]
                    }),
                    last: ob(function(a, b) {
                        return [b - 1]
                    }),
                    eq: ob(function(a, b, c) {
                        return [0 > c ? c + b : c]
                    }),
                    even: ob(function(a, b) {
                        for (var c = 0; b > c; c += 2)
                            a.push(c);
                        return a
                    }),
                    odd: ob(function(a, b) {
                        for (var c = 1; b > c; c += 2)
                            a.push(c);
                        return a
                    }),
                    lt: ob(function(a, b, c) {
                        for (var d = 0 > c ? c + b : c; --d >= 0; )
                            a.push(d);
                        return a
                    }),
                    gt: ob(function(a, b, c) {
                        for (var d = 0 > c ? c + b : c; ++d < b; )
                            a.push(d);
                        return a
                    })
                }
            },
            d.pseudos.nth = d.pseudos.eq;
        for (b in {
            radio: !0,
            checkbox: !0,
            file: !0,
            password: !0,
            image: !0
        })
            d.pseudos[b] = mb(b);
        for (b in {
            submit: !0,
            reset: !0
        })
            d.pseudos[b] = nb(b);
        function qb() {}
        qb.prototype = d.filters = d.pseudos,
            d.setFilters = new qb,
            g = gb.tokenize = function(a, b) {
                var c, e, f, g, h, i, j, k = z[a + " "];
                if (k)
                    return b ? 0 : k.slice(0);
                h = a,
                    i = [],
                    j = d.preFilter;
                while (h) {
                    (!c || (e = S.exec(h))) && (e && (h = h.slice(e[0].length) || h),
                        i.push(f = [])),
                        c = !1,
                        (e = T.exec(h)) && (c = e.shift(),
                        f.push({
                            value: c,
                            type: e[0].replace(R, " ")
                        }),
                        h = h.slice(c.length));
                    for (g in d.filter)
                        !(e = X[g].exec(h)) || j[g] && !(e = j[g](e)) || (c = e.shift(),
                            f.push({
                                value: c,
                                type: g,
                                matches: e
                            }),
                            h = h.slice(c.length));
                    if (!c)
                        break
                }
                return b ? h.length : h ? gb.error(a) : z(a, i).slice(0)
            }
        ;
        function rb(a) {
            for (var b = 0, c = a.length, d = ""; c > b; b++)
                d += a[b].value;
            return d
        }
        function sb(a, b, c) {
            var d = b.dir
                , e = c && "parentNode" === d
                , f = x++;
            return b.first ? function(b, c, f) {
                while (b = b[d])
                    if (1 === b.nodeType || e)
                        return a(b, c, f)
            }
                : function(b, c, g) {
                var h, i, j = [w, f];
                if (g) {
                    while (b = b[d])
                        if ((1 === b.nodeType || e) && a(b, c, g))
                            return !0
                } else
                    while (b = b[d])
                        if (1 === b.nodeType || e) {
                            if (i = b[u] || (b[u] = {}),
                                (h = i[d]) && h[0] === w && h[1] === f)
                                return j[2] = h[2];
                            if (i[d] = j,
                                j[2] = a(b, c, g))
                                return !0
                        }
            }
        }
        function tb(a) {
            return a.length > 1 ? function(b, c, d) {
                var e = a.length;
                while (e--)
                    if (!a[e](b, c, d))
                        return !1;
                return !0
            }
                : a[0]
        }
        function ub(a, b, c) {
            for (var d = 0, e = b.length; e > d; d++)
                gb(a, b[d], c);
            return c
        }
        function vb(a, b, c, d, e) {
            for (var f, g = [], h = 0, i = a.length, j = null != b; i > h; h++)
                (f = a[h]) && (!c || c(f, d, e)) && (g.push(f),
                    j && b.push(h));
            return g
        }
        function wb(a, b, c, d, e, f) {
            return d && !d[u] && (d = wb(d)),
                e && !e[u] && (e = wb(e, f)),
                ib(function(f, g, h, i) {
                    var j, k, l, m = [], n = [], o = g.length, p = f || ub(b || "*", h.nodeType ? [h] : h, []), q = !a || !f && b ? p : vb(p, m, a, h, i), r = c ? e || (f ? a : o || d) ? [] : g : q;
                    if (c && c(q, r, h, i),
                        d) {
                        j = vb(r, n),
                            d(j, [], h, i),
                            k = j.length;
                        while (k--)
                            (l = j[k]) && (r[n[k]] = !(q[n[k]] = l))
                    }
                    if (f) {
                        if (e || a) {
                            if (e) {
                                j = [],
                                    k = r.length;
                                while (k--)
                                    (l = r[k]) && j.push(q[k] = l);
                                e(null, r = [], j, i)
                            }
                            k = r.length;
                            while (k--)
                                (l = r[k]) && (j = e ? J(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l))
                        }
                    } else
                        r = vb(r === g ? r.splice(o, r.length) : r),
                            e ? e(null, g, r, i) : H.apply(g, r)
                })
        }
        function xb(a) {
            for (var b, c, e, f = a.length, g = d.relative[a[0].type], h = g || d.relative[" "], i = g ? 1 : 0, k = sb(function(a) {
                return a === b
            }, h, !0), l = sb(function(a) {
                return J(b, a) > -1
            }, h, !0), m = [function(a, c, d) {
                var e = !g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d));
                return b = null,
                    e
            }
            ]; f > i; i++)
                if (c = d.relative[a[i].type])
                    m = [sb(tb(m), c)];
                else {
                    if (c = d.filter[a[i].type].apply(null, a[i].matches),
                        c[u]) {
                        for (e = ++i; f > e; e++)
                            if (d.relative[a[e].type])
                                break;
                        return wb(i > 1 && tb(m), i > 1 && rb(a.slice(0, i - 1).concat({
                            value: " " === a[i - 2].type ? "*" : ""
                        })).replace(R, "$1"), c, e > i && xb(a.slice(i, e)), f > e && xb(a = a.slice(e)), f > e && rb(a))
                    }
                    m.push(c)
                }
            return tb(m)
        }
        function yb(a, b) {
            var c = b.length > 0
                , e = a.length > 0
                , f = function(f, g, h, i, k) {
                    var l, m, o, p = 0, q = "0", r = f && [], s = [], t = j, u = f || e && d.find.TAG("*", k), v = w += null == t ? 1 : Math.random() || .1, x = u.length;
                    for (k && (j = g !== n && g); q !== x && null != (l = u[q]); q++) {
                        if (e && l) {
                            m = 0;
                            while (o = a[m++])
                                if (o(l, g, h)) {
                                    i.push(l);
                                    break
                                }
                            k && (w = v)
                        }
                        c && ((l = !o && l) && p--,
                            f && r.push(l))
                    }
                    if (p += q,
                        c && q !== p) {
                        m = 0;
                        while (o = b[m++])
                            o(r, s, g, h);
                        if (f) {
                            if (p > 0)
                                while (q--)
                                    r[q] || s[q] || (s[q] = F.call(i));
                            s = vb(s)
                        }
                        H.apply(i, s),
                            k && !f && s.length > 0 && p + b.length > 1 && gb.uniqueSort(i)
                    }
                    return k && (w = v,
                        j = t),
                        r
                };
            return c ? ib(f) : f
        }
        return h = gb.compile = function(a, b) {
            var c, d = [], e = [], f = A[a + " "];
            if (!f) {
                b || (b = g(a)),
                    c = b.length;
                while (c--)
                    f = xb(b[c]),
                        f[u] ? d.push(f) : e.push(f);
                f = A(a, yb(e, d)),
                    f.selector = a
            }
            return f
        }
            ,
            i = gb.select = function(a, b, e, f) {
                var i, j, k, l, m, n = "function" == typeof a && a, o = !f && g(a = n.selector || a);
                if (e = e || [],
                    1 === o.length) {
                    if (j = o[0] = o[0].slice(0),
                        j.length > 2 && "ID" === (k = j[0]).type && c.getById && 9 === b.nodeType && p && d.relative[j[1].type]) {
                        if (b = (d.find.ID(k.matches[0].replace(cb, db), b) || [])[0],
                            !b)
                            return e;
                        n && (b = b.parentNode),
                            a = a.slice(j.shift().value.length)
                    }
                    i = X.needsContext.test(a) ? 0 : j.length;
                    while (i--) {
                        if (k = j[i],
                            d.relative[l = k.type])
                            break;
                        if ((m = d.find[l]) && (f = m(k.matches[0].replace(cb, db), ab.test(j[0].type) && pb(b.parentNode) || b))) {
                            if (j.splice(i, 1),
                                a = f.length && rb(j),
                                !a)
                                return H.apply(e, f),
                                    e;
                            break
                        }
                    }
                }
                return (n || h(a, o))(f, b, !p, e, ab.test(a) && pb(b.parentNode) || b),
                    e
            }
            ,
            c.sortStable = u.split("").sort(B).join("") === u,
            c.detectDuplicates = !!l,
            m(),
            c.sortDetached = jb(function(a) {
                return 1 & a.compareDocumentPosition(n.createElement("div"))
            }),
            jb(function(a) {
                return a.innerHTML = "<a href='#'></a>",
                    "#" === a.firstChild.getAttribute("href")
            }) || kb("type|href|height|width", function(a, b, c) {
            return c ? void 0 : a.getAttribute(b, "type" === b.toLowerCase() ? 1 : 2)
        }),
            c.attributes && jb(function(a) {
            return a.innerHTML = "<input/>",
                a.firstChild.setAttribute("value", ""),
                "" === a.firstChild.getAttribute("value")
        }) || kb("value", function(a, b, c) {
            return c || "input" !== a.nodeName.toLowerCase() ? void 0 : a.defaultValue
        }),
            jb(function(a) {
                return null == a.getAttribute("disabled")
            }) || kb(K, function(a, b, c) {
            var d;
            return c ? void 0 : a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null
        }),
            gb
    }(a);
    m.find = s,
        m.expr = s.selectors,
        m.expr[":"] = m.expr.pseudos,
        m.unique = s.uniqueSort,
        m.text = s.getText,
        m.isXMLDoc = s.isXML,
        m.contains = s.contains;
    var t = m.expr.match.needsContext
        , u = /^<(\w+)\s*\/?>(?:<\/\1>|)$/
        , v = /^.[^:#\[\.,]*$/;
    function w(a, b, c) {
        if (m.isFunction(b))
            return m.grep(a, function(a, d) {
                return !!b.call(a, d, a) !== c
            });
        if (b.nodeType)
            return m.grep(a, function(a) {
                return a === b !== c
            });
        if ("string" == typeof b) {
            if (v.test(b))
                return m.filter(b, a, c);
            b = m.filter(b, a)
        }
        return m.grep(a, function(a) {
            return m.inArray(a, b) >= 0 !== c
        })
    }
    m.filter = function(a, b, c) {
        var d = b[0];
        return c && (a = ":not(" + a + ")"),
                1 === b.length && 1 === d.nodeType ? m.find.matchesSelector(d, a) ? [d] : [] : m.find.matches(a, m.grep(b, function(a) {
            return 1 === a.nodeType
        }))
    }
        ,
        m.fn.extend({
            find: function(a) {
                var b, c = [], d = this, e = d.length;
                if ("string" != typeof a)
                    return this.pushStack(m(a).filter(function() {
                        for (b = 0; e > b; b++)
                            if (m.contains(d[b], this))
                                return !0
                    }));
                for (b = 0; e > b; b++)
                    m.find(a, d[b], c);
                return c = this.pushStack(e > 1 ? m.unique(c) : c),
                    c.selector = this.selector ? this.selector + " " + a : a,
                    c
            },
            filter: function(a) {
                return this.pushStack(w(this, a || [], !1))
            },
            not: function(a) {
                return this.pushStack(w(this, a || [], !0))
            },
            is: function(a) {
                return !!w(this, "string" == typeof a && t.test(a) ? m(a) : a || [], !1).length
            }
        });
    var x, y = a.document, z = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, A = m.fn.init = function(a, b) {
            var c, d;
            if (!a)
                return this;
            if ("string" == typeof a) {
                if (c = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && a.length >= 3 ? [null, a, null] : z.exec(a),
                    !c || !c[1] && b)
                    return !b || b.jquery ? (b || x).find(a) : this.constructor(b).find(a);
                if (c[1]) {
                    if (b = b instanceof m ? b[0] : b,
                        m.merge(this, m.parseHTML(c[1], b && b.nodeType ? b.ownerDocument || b : y, !0)),
                        u.test(c[1]) && m.isPlainObject(b))
                        for (c in b)
                            m.isFunction(this[c]) ? this[c](b[c]) : this.attr(c, b[c]);
                    return this
                }
                if (d = y.getElementById(c[2]),
                    d && d.parentNode) {
                    if (d.id !== c[2])
                        return x.find(a);
                    this.length = 1,
                        this[0] = d
                }
                return this.context = y,
                    this.selector = a,
                    this
            }
            return a.nodeType ? (this.context = this[0] = a,
                this.length = 1,
                this) : m.isFunction(a) ? "undefined" != typeof x.ready ? x.ready(a) : a(m) : (void 0 !== a.selector && (this.selector = a.selector,
                this.context = a.context),
                m.makeArray(a, this))
        }
        ;
    A.prototype = m.fn,
        x = m(y);
    var B = /^(?:parents|prev(?:Until|All))/
        , C = {
            children: !0,
            contents: !0,
            next: !0,
            prev: !0
        };
    m.extend({
        dir: function(a, b, c) {
            var d = []
                , e = a[b];
            while (e && 9 !== e.nodeType && (void 0 === c || 1 !== e.nodeType || !m(e).is(c)))
                1 === e.nodeType && d.push(e),
                    e = e[b];
            return d
        },
        sibling: function(a, b) {
            for (var c = []; a; a = a.nextSibling)
                1 === a.nodeType && a !== b && c.push(a);
            return c
        }
    }),
        m.fn.extend({
            has: function(a) {
                var b, c = m(a, this), d = c.length;
                return this.filter(function() {
                    for (b = 0; d > b; b++)
                        if (m.contains(this, c[b]))
                            return !0
                })
            },
            closest: function(a, b) {
                for (var c, d = 0, e = this.length, f = [], g = t.test(a) || "string" != typeof a ? m(a, b || this.context) : 0; e > d; d++)
                    for (c = this[d]; c && c !== b; c = c.parentNode)
                        if (c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && m.find.matchesSelector(c, a))) {
                            f.push(c);
                            break
                        }
                return this.pushStack(f.length > 1 ? m.unique(f) : f)
            },
            index: function(a) {
                return a ? "string" == typeof a ? m.inArray(this[0], m(a)) : m.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
            },
            add: function(a, b) {
                return this.pushStack(m.unique(m.merge(this.get(), m(a, b))))
            },
            addBack: function(a) {
                return this.add(null == a ? this.prevObject : this.prevObject.filter(a))
            }
        });
    function D(a, b) {
        do
            a = a[b];
        while (a && 1 !== a.nodeType);return a
    }
    m.each({
        parent: function(a) {
            var b = a.parentNode;
            return b && 11 !== b.nodeType ? b : null
        },
        parents: function(a) {
            return m.dir(a, "parentNode")
        },
        parentsUntil: function(a, b, c) {
            return m.dir(a, "parentNode", c)
        },
        next: function(a) {
            return D(a, "nextSibling")
        },
        prev: function(a) {
            return D(a, "previousSibling")
        },
        nextAll: function(a) {
            return m.dir(a, "nextSibling")
        },
        prevAll: function(a) {
            return m.dir(a, "previousSibling")
        },
        nextUntil: function(a, b, c) {
            return m.dir(a, "nextSibling", c)
        },
        prevUntil: function(a, b, c) {
            return m.dir(a, "previousSibling", c)
        },
        siblings: function(a) {
            return m.sibling((a.parentNode || {}).firstChild, a)
        },
        children: function(a) {
            return m.sibling(a.firstChild)
        },
        contents: function(a) {
            return m.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : m.merge([], a.childNodes)
        }
    }, function(a, b) {
        m.fn[a] = function(c, d) {
            var e = m.map(this, b, c);
            return "Until" !== a.slice(-5) && (d = c),
                d && "string" == typeof d && (e = m.filter(d, e)),
                this.length > 1 && (C[a] || (e = m.unique(e)),
                B.test(a) && (e = e.reverse())),
                this.pushStack(e)
        }
    });
    var E = /\S+/g
        , F = {};
    function G(a) {
        var b = F[a] = {};
        return m.each(a.match(E) || [], function(a, c) {
            b[c] = !0
        }),
            b
    }
    m.Callbacks = function(a) {
        a = "string" == typeof a ? F[a] || G(a) : m.extend({}, a);
        var b, c, d, e, f, g, h = [], i = !a.once && [], j = function(l) {
            for (c = a.memory && l,
                     d = !0,
                     f = g || 0,
                     g = 0,
                     e = h.length,
                     b = !0; h && e > f; f++)
                if (h[f].apply(l[0], l[1]) === !1 && a.stopOnFalse) {
                    c = !1;
                    break
                }
            b = !1,
                h && (i ? i.length && j(i.shift()) : c ? h = [] : k.disable())
        }, k = {
            add: function() {
                if (h) {
                    var d = h.length;
                    !function f(b) {
                        m.each(b, function(b, c) {
                            var d = m.type(c);
                            "function" === d ? a.unique && k.has(c) || h.push(c) : c && c.length && "string" !== d && f(c)
                        })
                    }(arguments),
                        b ? e = h.length : c && (g = d,
                            j(c))
                }
                return this
            },
            remove: function() {
                return h && m.each(arguments, function(a, c) {
                    var d;
                    while ((d = m.inArray(c, h, d)) > -1)
                        h.splice(d, 1),
                            b && (e >= d && e--,
                            f >= d && f--)
                }),
                    this
            },
            has: function(a) {
                return a ? m.inArray(a, h) > -1 : !(!h || !h.length)
            },
            empty: function() {
                return h = [],
                    e = 0,
                    this
            },
            disable: function() {
                return h = i = c = void 0,
                    this
            },
            disabled: function() {
                return !h
            },
            lock: function() {
                return i = void 0,
                    c || k.disable(),
                    this
            },
            locked: function() {
                return !i
            },
            fireWith: function(a, c) {
                return !h || d && !i || (c = c || [],
                    c = [a, c.slice ? c.slice() : c],
                    b ? i.push(c) : j(c)),
                    this
            },
            fire: function() {
                return k.fireWith(this, arguments),
                    this
            },
            fired: function() {
                return !!d
            }
        };
        return k
    }
        ,
        m.extend({
            Deferred: function(a) {
                var b = [["resolve", "done", m.Callbacks("once memory"), "resolved"], ["reject", "fail", m.Callbacks("once memory"), "rejected"], ["notify", "progress", m.Callbacks("memory")]]
                    , c = "pending"
                    , d = {
                        state: function() {
                            return c
                        },
                        always: function() {
                            return e.done(arguments).fail(arguments),
                                this
                        },
                        then: function() {
                            var a = arguments;
                            return m.Deferred(function(c) {
                                m.each(b, function(b, f) {
                                    var g = m.isFunction(a[b]) && a[b];
                                    e[f[1]](function() {
                                        var a = g && g.apply(this, arguments);
                                        a && m.isFunction(a.promise) ? a.promise().done(c.resolve).fail(c.reject).progress(c.notify) : c[f[0] + "With"](this === d ? c.promise() : this, g ? [a] : arguments)
                                    })
                                }),
                                    a = null
                            }).promise()
                        },
                        promise: function(a) {
                            return null != a ? m.extend(a, d) : d
                        }
                    }
                    , e = {};
                return d.pipe = d.then,
                    m.each(b, function(a, f) {
                        var g = f[2]
                            , h = f[3];
                        d[f[1]] = g.add,
                            h && g.add(function() {
                            c = h
                        }, b[1 ^ a][2].disable, b[2][2].lock),
                            e[f[0]] = function() {
                                return e[f[0] + "With"](this === e ? d : this, arguments),
                                    this
                            }
                            ,
                            e[f[0] + "With"] = g.fireWith
                    }),
                    d.promise(e),
                    a && a.call(e, e),
                    e
            },
            when: function(a) {
                var b = 0, c = d.call(arguments), e = c.length, f = 1 !== e || a && m.isFunction(a.promise) ? e : 0, g = 1 === f ? a : m.Deferred(), h = function(a, b, c) {
                    return function(e) {
                        b[a] = this,
                            c[a] = arguments.length > 1 ? d.call(arguments) : e,
                                c === i ? g.notifyWith(b, c) : --f || g.resolveWith(b, c)
                    }
                }, i, j, k;
                if (e > 1)
                    for (i = new Array(e),
                             j = new Array(e),
                             k = new Array(e); e > b; b++)
                        c[b] && m.isFunction(c[b].promise) ? c[b].promise().done(h(b, k, c)).fail(g.reject).progress(h(b, j, i)) : --f;
                return f || g.resolveWith(k, c),
                    g.promise()
            }
        });
    var H;
    m.fn.ready = function(a) {
        return m.ready.promise().done(a),
            this
    }
        ,
        m.extend({
            isReady: !1,
            readyWait: 1,
            holdReady: function(a) {
                a ? m.readyWait++ : m.ready(!0)
            },
            ready: function(a) {
                if (a === !0 ? !--m.readyWait : !m.isReady) {
                    if (!y.body)
                        return setTimeout(m.ready);
                    m.isReady = !0,
                        a !== !0 && --m.readyWait > 0 || (H.resolveWith(y, [m]),
                        m.fn.triggerHandler && (m(y).triggerHandler("ready"),
                        m(y).off("ready")))
                }
            }
        });
    function I() {
        y.addEventListener ? (y.removeEventListener("DOMContentLoaded", J, !1),
            a.removeEventListener("load", J, !1)) : (y.detachEvent("onreadystatechange", J),
            a.detachEvent("onload", J))
    }
    function J() {
        (y.addEventListener || "load" === event.type || "complete" === y.readyState) && (I(),
            m.ready())
    }
    m.ready.promise = function(b) {
        if (!H)
            if (H = m.Deferred(),
                "complete" === y.readyState)
                setTimeout(m.ready);
            else if (y.addEventListener)
                y.addEventListener("DOMContentLoaded", J, !1),
                    a.addEventListener("load", J, !1);
            else {
                y.attachEvent("onreadystatechange", J),
                    a.attachEvent("onload", J);
                var c = !1;
                try {
                    c = null == a.frameElement && y.documentElement
                } catch (d) {}
                c && c.doScroll && !function e() {
                    if (!m.isReady) {
                        try {
                            c.doScroll("left")
                        } catch (a) {
                            return setTimeout(e, 50)
                        }
                        I(),
                            m.ready()
                    }
                }()
            }
        return H.promise(b)
    }
    ;
    var K = "undefined", L;
    for (L in m(k))
        break;
    k.ownLast = "0" !== L,
        k.inlineBlockNeedsLayout = !1,
        m(function() {
            var a, b, c, d;
            c = y.getElementsByTagName("body")[0],
                c && c.style && (b = y.createElement("div"),
                d = y.createElement("div"),
                d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px",
                c.appendChild(d).appendChild(b),
                typeof b.style.zoom !== K && (b.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",
                k.inlineBlockNeedsLayout = a = 3 === b.offsetWidth,
                a && (c.style.zoom = 1)),
                c.removeChild(d))
        }),
        function() {
            var a = y.createElement("div");
            if (null == k.deleteExpando) {
                k.deleteExpando = !0;
                try {
                    delete a.test
                } catch (b) {
                    k.deleteExpando = !1
                }
            }
            a = null
        }(),
        m.acceptData = function(a) {
            var b = m.noData[(a.nodeName + " ").toLowerCase()]
                , c = +a.nodeType || 1;
            return 1 !== c && 9 !== c ? !1 : !b || b !== !0 && a.getAttribute("classid") === b
        }
    ;
    var M = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/
        , N = /([A-Z])/g;
    function O(a, b, c) {
        if (void 0 === c && 1 === a.nodeType) {
            var d = "data-" + b.replace(N, "-$1").toLowerCase();
            if (c = a.getAttribute(d),
                "string" == typeof c) {
                try {
                    c = "true" === c ? !0 : "false" === c ? !1 : "null" === c ? null : +c + "" === c ? +c : M.test(c) ? m.parseJSON(c) : c
                } catch (e) {}
                m.data(a, b, c)
            } else
                c = void 0
        }
        return c
    }
    function P(a) {
        var b;
        for (b in a)
            if (("data" !== b || !m.isEmptyObject(a[b])) && "toJSON" !== b)
                return !1;
        return !0
    }
    function Q(a, b, d, e) {
        if (m.acceptData(a)) {
            var f, g, h = m.expando, i = a.nodeType, j = i ? m.cache : a, k = i ? a[h] : a[h] && h;
            if (k && j[k] && (e || j[k].data) || void 0 !== d || "string" != typeof b)
                return k || (k = i ? a[h] = c.pop() || m.guid++ : h),
                    j[k] || (j[k] = i ? {} : {
                    toJSON: m.noop
                }),
                    ("object" == typeof b || "function" == typeof b) && (e ? j[k] = m.extend(j[k], b) : j[k].data = m.extend(j[k].data, b)),
                    g = j[k],
                    e || (g.data || (g.data = {}),
                    g = g.data),
                    void 0 !== d && (g[m.camelCase(b)] = d),
                        "string" == typeof b ? (f = g[b],
                    null == f && (f = g[m.camelCase(b)])) : f = g,
                    f
        }
    }
    function R(a, b, c) {
        if (m.acceptData(a)) {
            var d, e, f = a.nodeType, g = f ? m.cache : a, h = f ? a[m.expando] : m.expando;
            if (g[h]) {
                if (b && (d = c ? g[h] : g[h].data)) {
                    m.isArray(b) ? b = b.concat(m.map(b, m.camelCase)) : b in d ? b = [b] : (b = m.camelCase(b),
                        b = b in d ? [b] : b.split(" ")),
                        e = b.length;
                    while (e--)
                        delete d[b[e]];
                    if (c ? !P(d) : !m.isEmptyObject(d))
                        return
                }
                (c || (delete g[h].data,
                    P(g[h]))) && (f ? m.cleanData([a], !0) : k.deleteExpando || g != g.window ? delete g[h] : g[h] = null)
            }
        }
    }
    m.extend({
        cache: {},
        noData: {
            "applet ": !0,
            "embed ": !0,
            "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
        },
        hasData: function(a) {
            return a = a.nodeType ? m.cache[a[m.expando]] : a[m.expando],
                !!a && !P(a)
        },
        data: function(a, b, c) {
            return Q(a, b, c)
        },
        removeData: function(a, b) {
            return R(a, b)
        },
        _data: function(a, b, c) {
            return Q(a, b, c, !0)
        },
        _removeData: function(a, b) {
            return R(a, b, !0)
        }
    }),
        m.fn.extend({
            data: function(a, b) {
                var c, d, e, f = this[0], g = f && f.attributes;
                if (void 0 === a) {
                    if (this.length && (e = m.data(f),
                        1 === f.nodeType && !m._data(f, "parsedAttrs"))) {
                        c = g.length;
                        while (c--)
                            g[c] && (d = g[c].name,
                                0 === d.indexOf("data-") && (d = m.camelCase(d.slice(5)),
                                O(f, d, e[d])));
                        m._data(f, "parsedAttrs", !0)
                    }
                    return e
                }
                return "object" == typeof a ? this.each(function() {
                    m.data(this, a)
                }) : arguments.length > 1 ? this.each(function() {
                    m.data(this, a, b)
                }) : f ? O(f, a, m.data(f, a)) : void 0
            },
            removeData: function(a) {
                return this.each(function() {
                    m.removeData(this, a)
                })
            }
        }),
        m.extend({
            queue: function(a, b, c) {
                var d;
                return a ? (b = (b || "fx") + "queue",
                    d = m._data(a, b),
                    c && (!d || m.isArray(c) ? d = m._data(a, b, m.makeArray(c)) : d.push(c)),
                    d || []) : void 0
            },
            dequeue: function(a, b) {
                b = b || "fx";
                var c = m.queue(a, b)
                    , d = c.length
                    , e = c.shift()
                    , f = m._queueHooks(a, b)
                    , g = function() {
                        m.dequeue(a, b)
                    };
                "inprogress" === e && (e = c.shift(),
                    d--),
                    e && ("fx" === b && c.unshift("inprogress"),
                    delete f.stop,
                    e.call(a, g, f)),
                    !d && f && f.empty.fire()
            },
            _queueHooks: function(a, b) {
                var c = b + "queueHooks";
                return m._data(a, c) || m._data(a, c, {
                    empty: m.Callbacks("once memory").add(function() {
                        m._removeData(a, b + "queue"),
                            m._removeData(a, c)
                    })
                })
            }
        }),
        m.fn.extend({
            queue: function(a, b) {
                var c = 2;
                return "string" != typeof a && (b = a,
                    a = "fx",
                    c--),
                        arguments.length < c ? m.queue(this[0], a) : void 0 === b ? this : this.each(function() {
                    var c = m.queue(this, a, b);
                    m._queueHooks(this, a),
                        "fx" === a && "inprogress" !== c[0] && m.dequeue(this, a)
                })
            },
            dequeue: function(a) {
                return this.each(function() {
                    m.dequeue(this, a)
                })
            },
            clearQueue: function(a) {
                return this.queue(a || "fx", [])
            },
            promise: function(a, b) {
                var c, d = 1, e = m.Deferred(), f = this, g = this.length, h = function() {
                    --d || e.resolveWith(f, [f])
                };
                "string" != typeof a && (b = a,
                    a = void 0),
                    a = a || "fx";
                while (g--)
                    c = m._data(f[g], a + "queueHooks"),
                        c && c.empty && (d++,
                        c.empty.add(h));
                return h(),
                    e.promise(b)
            }
        });
    var S = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source
        , T = ["Top", "Right", "Bottom", "Left"]
        , U = function(a, b) {
            return a = b || a,
                "none" === m.css(a, "display") || !m.contains(a.ownerDocument, a)
        }
        , V = m.access = function(a, b, c, d, e, f, g) {
            var h = 0
                , i = a.length
                , j = null == c;
            if ("object" === m.type(c)) {
                e = !0;
                for (h in c)
                    m.access(a, b, h, c[h], !0, f, g)
            } else if (void 0 !== d && (e = !0,
                m.isFunction(d) || (g = !0),
                j && (g ? (b.call(a, d),
                b = null) : (j = b,
                b = function(a, b, c) {
                    return j.call(m(a), c)
                }
                )),
                b))
                for (; i > h; h++)
                    b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c)));
            return e ? a : j ? b.call(a) : i ? b(a[0], c) : f
        }
        , W = /^(?:checkbox|radio)$/i;
    !function() {
        var a = y.createElement("input")
            , b = y.createElement("div")
            , c = y.createDocumentFragment();
        if (b.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",
            k.leadingWhitespace = 3 === b.firstChild.nodeType,
            k.tbody = !b.getElementsByTagName("tbody").length,
            k.htmlSerialize = !!b.getElementsByTagName("link").length,
            k.html5Clone = "<:nav></:nav>" !== y.createElement("nav").cloneNode(!0).outerHTML,
            a.type = "checkbox",
            a.checked = !0,
            c.appendChild(a),
            k.appendChecked = a.checked,
            b.innerHTML = "<textarea>x</textarea>",
            k.noCloneChecked = !!b.cloneNode(!0).lastChild.defaultValue,
            c.appendChild(b),
            b.innerHTML = "<input type='radio' checked='checked' name='t'/>",
            k.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked,
            k.noCloneEvent = !0,
            b.attachEvent && (b.attachEvent("onclick", function() {
            k.noCloneEvent = !1
        }),
            b.cloneNode(!0).click()),
            null == k.deleteExpando) {
            k.deleteExpando = !0;
            try {
                delete b.test
            } catch (d) {
                k.deleteExpando = !1
            }
        }
    }(),
        function() {
            var b, c, d = y.createElement("div");
            for (b in {
                submit: !0,
                change: !0,
                focusin: !0
            })
                c = "on" + b,
                    (k[b + "Bubbles"] = c in a) || (d.setAttribute(c, "t"),
                    k[b + "Bubbles"] = d.attributes[c].expando === !1);
            d = null
        }();
    var X = /^(?:input|select|textarea)$/i
        , Y = /^key/
        , Z = /^(?:mouse|pointer|contextmenu)|click/
        , $ = /^(?:focusinfocus|focusoutblur)$/
        , _ = /^([^.]*)(?:\.(.+)|)$/;
    function ab() {
        return !0
    }
    function bb() {
        return !1
    }
    function cb() {
        try {
            return y.activeElement
        } catch (a) {}
    }
    m.event = {
        global: {},
        add: function(a, b, c, d, e) {
            var f, g, h, i, j, k, l, n, o, p, q, r = m._data(a);
            if (r) {
                c.handler && (i = c,
                    c = i.handler,
                    e = i.selector),
                    c.guid || (c.guid = m.guid++),
                    (g = r.events) || (g = r.events = {}),
                    (k = r.handle) || (k = r.handle = function(a) {
                    return typeof m === K || a && m.event.triggered === a.type ? void 0 : m.event.dispatch.apply(k.elem, arguments)
                }
                    ,
                    k.elem = a),
                    b = (b || "").match(E) || [""],
                    h = b.length;
                while (h--)
                    f = _.exec(b[h]) || [],
                        o = q = f[1],
                        p = (f[2] || "").split(".").sort(),
                        o && (j = m.event.special[o] || {},
                        o = (e ? j.delegateType : j.bindType) || o,
                        j = m.event.special[o] || {},
                        l = m.extend({
                            type: o,
                            origType: q,
                            data: d,
                            handler: c,
                            guid: c.guid,
                            selector: e,
                            needsContext: e && m.expr.match.needsContext.test(e),
                            namespace: p.join(".")
                        }, i),
                        (n = g[o]) || (n = g[o] = [],
                        n.delegateCount = 0,
                        j.setup && j.setup.call(a, d, p, k) !== !1 || (a.addEventListener ? a.addEventListener(o, k, !1) : a.attachEvent && a.attachEvent("on" + o, k))),
                        j.add && (j.add.call(a, l),
                        l.handler.guid || (l.handler.guid = c.guid)),
                        e ? n.splice(n.delegateCount++, 0, l) : n.push(l),
                        m.event.global[o] = !0);
                a = null
            }
        },
        remove: function(a, b, c, d, e) {
            var f, g, h, i, j, k, l, n, o, p, q, r = m.hasData(a) && m._data(a);
            if (r && (k = r.events)) {
                b = (b || "").match(E) || [""],
                    j = b.length;
                while (j--)
                    if (h = _.exec(b[j]) || [],
                        o = q = h[1],
                        p = (h[2] || "").split(".").sort(),
                        o) {
                        l = m.event.special[o] || {},
                            o = (d ? l.delegateType : l.bindType) || o,
                            n = k[o] || [],
                            h = h[2] && new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)"),
                            i = f = n.length;
                        while (f--)
                            g = n[f],
                                !e && q !== g.origType || c && c.guid !== g.guid || h && !h.test(g.namespace) || d && d !== g.selector && ("**" !== d || !g.selector) || (n.splice(f, 1),
                                g.selector && n.delegateCount--,
                                l.remove && l.remove.call(a, g));
                        i && !n.length && (l.teardown && l.teardown.call(a, p, r.handle) !== !1 || m.removeEvent(a, o, r.handle),
                            delete k[o])
                    } else
                        for (o in k)
                            m.event.remove(a, o + b[j], c, d, !0);
                m.isEmptyObject(k) && (delete r.handle,
                    m._removeData(a, "events"))
            }
        },
        trigger: function(b, c, d, e) {
            var f, g, h, i, k, l, n, o = [d || y], p = j.call(b, "type") ? b.type : b, q = j.call(b, "namespace") ? b.namespace.split(".") : [];
            if (h = l = d = d || y,
                3 !== d.nodeType && 8 !== d.nodeType && !$.test(p + m.event.triggered) && (p.indexOf(".") >= 0 && (q = p.split("."),
                p = q.shift(),
                q.sort()),
                g = p.indexOf(":") < 0 && "on" + p,
                b = b[m.expando] ? b : new m.Event(p,"object" == typeof b && b),
                b.isTrigger = e ? 2 : 3,
                b.namespace = q.join("."),
                b.namespace_re = b.namespace ? new RegExp("(^|\\.)" + q.join("\\.(?:.*\\.|)") + "(\\.|$)") : null,
                b.result = void 0,
                b.target || (b.target = d),
                c = null == c ? [b] : m.makeArray(c, [b]),
                k = m.event.special[p] || {},
                e || !k.trigger || k.trigger.apply(d, c) !== !1)) {
                if (!e && !k.noBubble && !m.isWindow(d)) {
                    for (i = k.delegateType || p,
                             $.test(i + p) || (h = h.parentNode); h; h = h.parentNode)
                        o.push(h),
                            l = h;
                    l === (d.ownerDocument || y) && o.push(l.defaultView || l.parentWindow || a)
                }
                n = 0;
                while ((h = o[n++]) && !b.isPropagationStopped())
                    b.type = n > 1 ? i : k.bindType || p,
                        f = (m._data(h, "events") || {})[b.type] && m._data(h, "handle"),
                        f && f.apply(h, c),
                        f = g && h[g],
                        f && f.apply && m.acceptData(h) && (b.result = f.apply(h, c),
                        b.result === !1 && b.preventDefault());
                if (b.type = p,
                    !e && !b.isDefaultPrevented() && (!k._default || k._default.apply(o.pop(), c) === !1) && m.acceptData(d) && g && d[p] && !m.isWindow(d)) {
                    l = d[g],
                        l && (d[g] = null),
                        m.event.triggered = p;
                    try {
                        d[p]()
                    } catch (r) {}
                    m.event.triggered = void 0,
                        l && (d[g] = l)
                }
                return b.result
            }
        },
        dispatch: function(a) {
            a = m.event.fix(a);
            var b, c, e, f, g, h = [], i = d.call(arguments), j = (m._data(this, "events") || {})[a.type] || [], k = m.event.special[a.type] || {};
            if (i[0] = a,
                a.delegateTarget = this,
                !k.preDispatch || k.preDispatch.call(this, a) !== !1) {
                h = m.event.handlers.call(this, a, j),
                    b = 0;
                while ((f = h[b++]) && !a.isPropagationStopped()) {
                    a.currentTarget = f.elem,
                        g = 0;
                    while ((e = f.handlers[g++]) && !a.isImmediatePropagationStopped())
                        (!a.namespace_re || a.namespace_re.test(e.namespace)) && (a.handleObj = e,
                            a.data = e.data,
                            c = ((m.event.special[e.origType] || {}).handle || e.handler).apply(f.elem, i),
                            void 0 !== c && (a.result = c) === !1 && (a.preventDefault(),
                            a.stopPropagation()))
                }
                return k.postDispatch && k.postDispatch.call(this, a),
                    a.result
            }
        },
        handlers: function(a, b) {
            var c, d, e, f, g = [], h = b.delegateCount, i = a.target;
            if (h && i.nodeType && (!a.button || "click" !== a.type))
                for (; i != this; i = i.parentNode || this)
                    if (1 === i.nodeType && (i.disabled !== !0 || "click" !== a.type)) {
                        for (e = [],
                                 f = 0; h > f; f++)
                            d = b[f],
                                c = d.selector + " ",
                                void 0 === e[c] && (e[c] = d.needsContext ? m(c, this).index(i) >= 0 : m.find(c, this, null, [i]).length),
                                e[c] && e.push(d);
                        e.length && g.push({
                            elem: i,
                            handlers: e
                        })
                    }
            return h < b.length && g.push({
                elem: this,
                handlers: b.slice(h)
            }),
                g
        },
        fix: function(a) {
            if (a[m.expando])
                return a;
            var b, c, d, e = a.type, f = a, g = this.fixHooks[e];
            g || (this.fixHooks[e] = g = Z.test(e) ? this.mouseHooks : Y.test(e) ? this.keyHooks : {}),
                d = g.props ? this.props.concat(g.props) : this.props,
                a = new m.Event(f),
                b = d.length;
            while (b--)
                c = d[b],
                    a[c] = f[c];
            return a.target || (a.target = f.srcElement || y),
                3 === a.target.nodeType && (a.target = a.target.parentNode),
                a.metaKey = !!a.metaKey,
                g.filter ? g.filter(a, f) : a
        },
        props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
        fixHooks: {},
        keyHooks: {
            props: "char charCode key keyCode".split(" "),
            filter: function(a, b) {
                return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode),
                    a
            }
        },
        mouseHooks: {
            props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
            filter: function(a, b) {
                var c, d, e, f = b.button, g = b.fromElement;
                return null == a.pageX && null != b.clientX && (d = a.target.ownerDocument || y,
                    e = d.documentElement,
                    c = d.body,
                    a.pageX = b.clientX + (e && e.scrollLeft || c && c.scrollLeft || 0) - (e && e.clientLeft || c && c.clientLeft || 0),
                    a.pageY = b.clientY + (e && e.scrollTop || c && c.scrollTop || 0) - (e && e.clientTop || c && c.clientTop || 0)),
                    !a.relatedTarget && g && (a.relatedTarget = g === a.target ? b.toElement : g),
                    a.which || void 0 === f || (a.which = 1 & f ? 1 : 2 & f ? 3 : 4 & f ? 2 : 0),
                    a
            }
        },
        special: {
            load: {
                noBubble: !0
            },
            focus: {
                trigger: function() {
                    if (this !== cb() && this.focus)
                        try {
                            return this.focus(),
                                !1
                        } catch (a) {}
                },
                delegateType: "focusin"
            },
            blur: {
                trigger: function() {
                    return this === cb() && this.blur ? (this.blur(),
                        !1) : void 0
                },
                delegateType: "focusout"
            },
            click: {
                trigger: function() {
                    return m.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(),
                        !1) : void 0
                },
                _default: function(a) {
                    return m.nodeName(a.target, "a")
                }
            },
            beforeunload: {
                postDispatch: function(a) {
                    void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result)
                }
            }
        },
        simulate: function(a, b, c, d) {
            var e = m.extend(new m.Event, c, {
                type: a,
                isSimulated: !0,
                originalEvent: {}
            });
            d ? m.event.trigger(e, null, b) : m.event.dispatch.call(b, e),
                e.isDefaultPrevented() && c.preventDefault()
        }
    },
        m.removeEvent = y.removeEventListener ? function(a, b, c) {
            a.removeEventListener && a.removeEventListener(b, c, !1)
        }
            : function(a, b, c) {
            var d = "on" + b;
            a.detachEvent && (typeof a[d] === K && (a[d] = null),
                a.detachEvent(d, c))
        }
        ,
        m.Event = function(a, b) {
            return this instanceof m.Event ? (a && a.type ? (this.originalEvent = a,
                this.type = a.type,
                this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.returnValue === !1 ? ab : bb) : this.type = a,
                b && m.extend(this, b),
                this.timeStamp = a && a.timeStamp || m.now(),
                void (this[m.expando] = !0)) : new m.Event(a,b)
        }
        ,
        m.Event.prototype = {
            isDefaultPrevented: bb,
            isPropagationStopped: bb,
            isImmediatePropagationStopped: bb,
            preventDefault: function() {
                var a = this.originalEvent;
                this.isDefaultPrevented = ab,
                    a && (a.preventDefault ? a.preventDefault() : a.returnValue = !1)
            },
            stopPropagation: function() {
                var a = this.originalEvent;
                this.isPropagationStopped = ab,
                    a && (a.stopPropagation && a.stopPropagation(),
                    a.cancelBubble = !0)
            },
            stopImmediatePropagation: function() {
                var a = this.originalEvent;
                this.isImmediatePropagationStopped = ab,
                    a && a.stopImmediatePropagation && a.stopImmediatePropagation(),
                    this.stopPropagation()
            }
        },
        m.each({
            mouseenter: "mouseover",
            mouseleave: "mouseout",
            pointerenter: "pointerover",
            pointerleave: "pointerout"
        }, function(a, b) {
            m.event.special[a] = {
                delegateType: b,
                bindType: b,
                handle: function(a) {
                    var c, d = this, e = a.relatedTarget, f = a.handleObj;
                    return (!e || e !== d && !m.contains(d, e)) && (a.type = f.origType,
                        c = f.handler.apply(this, arguments),
                        a.type = b),
                        c
                }
            }
        }),
        k.submitBubbles || (m.event.special.submit = {
        setup: function() {
            return m.nodeName(this, "form") ? !1 : void m.event.add(this, "click._submit keypress._submit", function(a) {
                var b = a.target
                    , c = m.nodeName(b, "input") || m.nodeName(b, "button") ? b.form : void 0;
                c && !m._data(c, "submitBubbles") && (m.event.add(c, "submit._submit", function(a) {
                    a._submit_bubble = !0
                }),
                    m._data(c, "submitBubbles", !0))
            })
        },
        postDispatch: function(a) {
            a._submit_bubble && (delete a._submit_bubble,
                this.parentNode && !a.isTrigger && m.event.simulate("submit", this.parentNode, a, !0))
        },
        teardown: function() {
            return m.nodeName(this, "form") ? !1 : void m.event.remove(this, "._submit")
        }
    }),
        k.changeBubbles || (m.event.special.change = {
        setup: function() {
            return X.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (m.event.add(this, "propertychange._change", function(a) {
                "checked" === a.originalEvent.propertyName && (this._just_changed = !0)
            }),
                m.event.add(this, "click._change", function(a) {
                    this._just_changed && !a.isTrigger && (this._just_changed = !1),
                        m.event.simulate("change", this, a, !0)
                })),
                !1) : void m.event.add(this, "beforeactivate._change", function(a) {
                var b = a.target;
                X.test(b.nodeName) && !m._data(b, "changeBubbles") && (m.event.add(b, "change._change", function(a) {
                    !this.parentNode || a.isSimulated || a.isTrigger || m.event.simulate("change", this.parentNode, a, !0)
                }),
                    m._data(b, "changeBubbles", !0))
            })
        },
        handle: function(a) {
            var b = a.target;
            return this !== b || a.isSimulated || a.isTrigger || "radio" !== b.type && "checkbox" !== b.type ? a.handleObj.handler.apply(this, arguments) : void 0
        },
        teardown: function() {
            return m.event.remove(this, "._change"),
                !X.test(this.nodeName)
        }
    }),
        k.focusinBubbles || m.each({
        focus: "focusin",
        blur: "focusout"
    }, function(a, b) {
        var c = function(a) {
            m.event.simulate(b, a.target, m.event.fix(a), !0)
        };
        m.event.special[b] = {
            setup: function() {
                var d = this.ownerDocument || this
                    , e = m._data(d, b);
                e || d.addEventListener(a, c, !0),
                    m._data(d, b, (e || 0) + 1)
            },
            teardown: function() {
                var d = this.ownerDocument || this
                    , e = m._data(d, b) - 1;
                e ? m._data(d, b, e) : (d.removeEventListener(a, c, !0),
                    m._removeData(d, b))
            }
        }
    }),
        m.fn.extend({
            on: function(a, b, c, d, e) {
                var f, g;
                if ("object" == typeof a) {
                    "string" != typeof b && (c = c || b,
                        b = void 0);
                    for (f in a)
                        this.on(f, b, c, a[f], e);
                    return this
                }
                if (null == c && null == d ? (d = b,
                    c = b = void 0) : null == d && ("string" == typeof b ? (d = c,
                    c = void 0) : (d = c,
                    c = b,
                    b = void 0)),
                    d === !1)
                    d = bb;
                else if (!d)
                    return this;
                return 1 === e && (g = d,
                    d = function(a) {
                        return m().off(a),
                            g.apply(this, arguments)
                    }
                    ,
                    d.guid = g.guid || (g.guid = m.guid++)),
                    this.each(function() {
                        m.event.add(this, a, d, c, b)
                    })
            },
            one: function(a, b, c, d) {
                return this.on(a, b, c, d, 1)
            },
            off: function(a, b, c) {
                var d, e;
                if (a && a.preventDefault && a.handleObj)
                    return d = a.handleObj,
                        m(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler),
                        this;
                if ("object" == typeof a) {
                    for (e in a)
                        this.off(e, b, a[e]);
                    return this
                }
                return (b === !1 || "function" == typeof b) && (c = b,
                    b = void 0),
                    c === !1 && (c = bb),
                    this.each(function() {
                        m.event.remove(this, a, c, b)
                    })
            },
            trigger: function(a, b) {
                return this.each(function() {
                    m.event.trigger(a, b, this)
                })
            },
            triggerHandler: function(a, b) {
                var c = this[0];
                return c ? m.event.trigger(a, b, c, !0) : void 0
            }
        });
    function db(a) {
        var b = eb.split("|")
            , c = a.createDocumentFragment();
        if (c.createElement)
            while (b.length)
                c.createElement(b.pop());
        return c
    }
    var eb = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video"
        , fb = / jQuery\d+="(?:null|\d+)"/g
        , gb = new RegExp("<(?:" + eb + ")[\\s/>]","i")
        , hb = /^\s+/
        , ib = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi
        , jb = /<([\w:]+)/
        , kb = /<tbody/i
        , lb = /<|&#?\w+;/
        , mb = /<(?:script|style|link)/i
        , nb = /checked\s*(?:[^=]|=\s*.checked.)/i
        , ob = /^$|\/(?:java|ecma)script/i
        , pb = /^true\/(.*)/
        , qb = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g
        , rb = {
            option: [1, "<select multiple='multiple'>", "</select>"],
            legend: [1, "<fieldset>", "</fieldset>"],
            area: [1, "<map>", "</map>"],
            param: [1, "<object>", "</object>"],
            thead: [1, "<table>", "</table>"],
            tr: [2, "<table><tbody>", "</tbody></table>"],
            col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
            td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
            _default: k.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"]
        }
        , sb = db(y)
        , tb = sb.appendChild(y.createElement("div"));
    rb.optgroup = rb.option,
        rb.tbody = rb.tfoot = rb.colgroup = rb.caption = rb.thead,
        rb.th = rb.td;
    function ub(a, b) {
        var c, d, e = 0, f = typeof a.getElementsByTagName !== K ? a.getElementsByTagName(b || "*") : typeof a.querySelectorAll !== K ? a.querySelectorAll(b || "*") : void 0;
        if (!f)
            for (f = [],
                     c = a.childNodes || a; null != (d = c[e]); e++)
                !b || m.nodeName(d, b) ? f.push(d) : m.merge(f, ub(d, b));
        return void 0 === b || b && m.nodeName(a, b) ? m.merge([a], f) : f
    }
    function vb(a) {
        W.test(a.type) && (a.defaultChecked = a.checked)
    }
    function wb(a, b) {
        return m.nodeName(a, "table") && m.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a
    }
    function xb(a) {
        return a.type = (null !== m.find.attr(a, "type")) + "/" + a.type,
            a
    }
    function yb(a) {
        var b = pb.exec(a.type);
        return b ? a.type = b[1] : a.removeAttribute("type"),
            a
    }
    function zb(a, b) {
        for (var c, d = 0; null != (c = a[d]); d++)
            m._data(c, "globalEval", !b || m._data(b[d], "globalEval"))
    }
    function Ab(a, b) {
        if (1 === b.nodeType && m.hasData(a)) {
            var c, d, e, f = m._data(a), g = m._data(b, f), h = f.events;
            if (h) {
                delete g.handle,
                    g.events = {};
                for (c in h)
                    for (d = 0,
                             e = h[c].length; e > d; d++)
                        m.event.add(b, c, h[c][d])
            }
            g.data && (g.data = m.extend({}, g.data))
        }
    }
    function Bb(a, b) {
        var c, d, e;
        if (1 === b.nodeType) {
            if (c = b.nodeName.toLowerCase(),
                !k.noCloneEvent && b[m.expando]) {
                e = m._data(b);
                for (d in e.events)
                    m.removeEvent(b, d, e.handle);
                b.removeAttribute(m.expando)
            }
            "script" === c && b.text !== a.text ? (xb(b).text = a.text,
                yb(b)) : "object" === c ? (b.parentNode && (b.outerHTML = a.outerHTML),
                k.html5Clone && a.innerHTML && !m.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : "input" === c && W.test(a.type) ? (b.defaultChecked = b.checked = a.checked,
                b.value !== a.value && (b.value = a.value)) : "option" === c ? b.defaultSelected = b.selected = a.defaultSelected : ("input" === c || "textarea" === c) && (b.defaultValue = a.defaultValue)
        }
    }
    m.extend({
        clone: function(a, b, c) {
            var d, e, f, g, h, i = m.contains(a.ownerDocument, a);
            if (k.html5Clone || m.isXMLDoc(a) || !gb.test("<" + a.nodeName + ">") ? f = a.cloneNode(!0) : (tb.innerHTML = a.outerHTML,
                tb.removeChild(f = tb.firstChild)),
                !(k.noCloneEvent && k.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || m.isXMLDoc(a)))
                for (d = ub(f),
                         h = ub(a),
                         g = 0; null != (e = h[g]); ++g)
                    d[g] && Bb(e, d[g]);
            if (b)
                if (c)
                    for (h = h || ub(a),
                             d = d || ub(f),
                             g = 0; null != (e = h[g]); g++)
                        Ab(e, d[g]);
                else
                    Ab(a, f);
            return d = ub(f, "script"),
                d.length > 0 && zb(d, !i && ub(a, "script")),
                d = h = e = null,
                f
        },
        buildFragment: function(a, b, c, d) {
            for (var e, f, g, h, i, j, l, n = a.length, o = db(b), p = [], q = 0; n > q; q++)
                if (f = a[q],
                    f || 0 === f)
                    if ("object" === m.type(f))
                        m.merge(p, f.nodeType ? [f] : f);
                    else if (lb.test(f)) {
                        h = h || o.appendChild(b.createElement("div")),
                            i = (jb.exec(f) || ["", ""])[1].toLowerCase(),
                            l = rb[i] || rb._default,
                            h.innerHTML = l[1] + f.replace(ib, "<$1></$2>") + l[2],
                            e = l[0];
                        while (e--)
                            h = h.lastChild;
                        if (!k.leadingWhitespace && hb.test(f) && p.push(b.createTextNode(hb.exec(f)[0])),
                            !k.tbody) {
                            f = "table" !== i || kb.test(f) ? "<table>" !== l[1] || kb.test(f) ? 0 : h : h.firstChild,
                                e = f && f.childNodes.length;
                            while (e--)
                                m.nodeName(j = f.childNodes[e], "tbody") && !j.childNodes.length && f.removeChild(j)
                        }
                        m.merge(p, h.childNodes),
                            h.textContent = "";
                        while (h.firstChild)
                            h.removeChild(h.firstChild);
                        h = o.lastChild
                    } else
                        p.push(b.createTextNode(f));
            h && o.removeChild(h),
                k.appendChecked || m.grep(ub(p, "input"), vb),
                q = 0;
            while (f = p[q++])
                if ((!d || -1 === m.inArray(f, d)) && (g = m.contains(f.ownerDocument, f),
                    h = ub(o.appendChild(f), "script"),
                    g && zb(h),
                    c)) {
                    e = 0;
                    while (f = h[e++])
                        ob.test(f.type || "") && c.push(f)
                }
            return h = null,
                o
        },
        cleanData: function(a, b) {
            for (var d, e, f, g, h = 0, i = m.expando, j = m.cache, l = k.deleteExpando, n = m.event.special; null != (d = a[h]); h++)
                if ((b || m.acceptData(d)) && (f = d[i],
                    g = f && j[f])) {
                    if (g.events)
                        for (e in g.events)
                            n[e] ? m.event.remove(d, e) : m.removeEvent(d, e, g.handle);
                    j[f] && (delete j[f],
                        l ? delete d[i] : typeof d.removeAttribute !== K ? d.removeAttribute(i) : d[i] = null,
                        c.push(f))
                }
        }
    }),
        m.fn.extend({
            text: function(a) {
                return V(this, function(a) {
                    return void 0 === a ? m.text(this) : this.empty().append((this[0] && this[0].ownerDocument || y).createTextNode(a))
                }, null, a, arguments.length)
            },
            append: function() {
                return this.domManip(arguments, function(a) {
                    if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
                        var b = wb(this, a);
                        b.appendChild(a)
                    }
                })
            },
            prepend: function() {
                return this.domManip(arguments, function(a) {
                    if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
                        var b = wb(this, a);
                        b.insertBefore(a, b.firstChild)
                    }
                })
            },
            before: function() {
                return this.domManip(arguments, function(a) {
                    this.parentNode && this.parentNode.insertBefore(a, this)
                })
            },
            after: function() {
                return this.domManip(arguments, function(a) {
                    this.parentNode && this.parentNode.insertBefore(a, this.nextSibling)
                })
            },
            remove: function(a, b) {
                for (var c, d = a ? m.filter(a, this) : this, e = 0; null != (c = d[e]); e++)
                    b || 1 !== c.nodeType || m.cleanData(ub(c)),
                        c.parentNode && (b && m.contains(c.ownerDocument, c) && zb(ub(c, "script")),
                        c.parentNode.removeChild(c));
                return this
            },
            empty: function() {
                for (var a, b = 0; null != (a = this[b]); b++) {
                    1 === a.nodeType && m.cleanData(ub(a, !1));
                    while (a.firstChild)
                        a.removeChild(a.firstChild);
                    a.options && m.nodeName(a, "select") && (a.options.length = 0)
                }
                return this
            },
            clone: function(a, b) {
                return a = null == a ? !1 : a,
                    b = null == b ? a : b,
                    this.map(function() {
                        return m.clone(this, a, b)
                    })
            },
            html: function(a) {
                return V(this, function(a) {
                    var b = this[0] || {}
                        , c = 0
                        , d = this.length;
                    if (void 0 === a)
                        return 1 === b.nodeType ? b.innerHTML.replace(fb, "") : void 0;
                    if (!("string" != typeof a || mb.test(a) || !k.htmlSerialize && gb.test(a) || !k.leadingWhitespace && hb.test(a) || rb[(jb.exec(a) || ["", ""])[1].toLowerCase()])) {
                        a = a.replace(ib, "<$1></$2>");
                        try {
                            for (; d > c; c++)
                                b = this[c] || {},
                                    1 === b.nodeType && (m.cleanData(ub(b, !1)),
                                    b.innerHTML = a);
                            b = 0
                        } catch (e) {}
                    }
                    b && this.empty().append(a)
                }, null, a, arguments.length)
            },
            replaceWith: function() {
                var a = arguments[0];
                return this.domManip(arguments, function(b) {
                    a = this.parentNode,
                        m.cleanData(ub(this)),
                        a && a.replaceChild(b, this)
                }),
                        a && (a.length || a.nodeType) ? this : this.remove()
            },
            detach: function(a) {
                return this.remove(a, !0)
            },
            domManip: function(a, b) {
                a = e.apply([], a);
                var c, d, f, g, h, i, j = 0, l = this.length, n = this, o = l - 1, p = a[0], q = m.isFunction(p);
                if (q || l > 1 && "string" == typeof p && !k.checkClone && nb.test(p))
                    return this.each(function(c) {
                        var d = n.eq(c);
                        q && (a[0] = p.call(this, c, d.html())),
                            d.domManip(a, b)
                    });
                if (l && (i = m.buildFragment(a, this[0].ownerDocument, !1, this),
                    c = i.firstChild,
                    1 === i.childNodes.length && (i = c),
                    c)) {
                    for (g = m.map(ub(i, "script"), xb),
                             f = g.length; l > j; j++)
                        d = i,
                            j !== o && (d = m.clone(d, !0, !0),
                            f && m.merge(g, ub(d, "script"))),
                            b.call(this[j], d, j);
                    if (f)
                        for (h = g[g.length - 1].ownerDocument,
                                 m.map(g, yb),
                                 j = 0; f > j; j++)
                            d = g[j],
                                ob.test(d.type || "") && !m._data(d, "globalEval") && m.contains(h, d) && (d.src ? m._evalUrl && m._evalUrl(d.src) : m.globalEval((d.text || d.textContent || d.innerHTML || "").replace(qb, "")));
                    i = c = null
                }
                return this
            }
        }),
        m.each({
            appendTo: "append",
            prependTo: "prepend",
            insertBefore: "before",
            insertAfter: "after",
            replaceAll: "replaceWith"
        }, function(a, b) {
            m.fn[a] = function(a) {
                for (var c, d = 0, e = [], g = m(a), h = g.length - 1; h >= d; d++)
                    c = d === h ? this : this.clone(!0),
                        m(g[d])[b](c),
                        f.apply(e, c.get());
                return this.pushStack(e)
            }
        });
    var Cb, Db = {};
    function Eb(b, c) {
        var d, e = m(c.createElement(b)).appendTo(c.body), f = a.getDefaultComputedStyle && (d = a.getDefaultComputedStyle(e[0])) ? d.display : m.css(e[0], "display");
        return e.detach(),
            f
    }
    function Fb(a) {
        var b = y
            , c = Db[a];
        return c || (c = Eb(a, b),
            "none" !== c && c || (Cb = (Cb || m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),
            b = (Cb[0].contentWindow || Cb[0].contentDocument).document,
            b.write(),
            b.close(),
            c = Eb(a, b),
            Cb.detach()),
            Db[a] = c),
            c
    }
    !function() {
        var a;
        k.shrinkWrapBlocks = function() {
            if (null != a)
                return a;
            a = !1;
            var b, c, d;
            return c = y.getElementsByTagName("body")[0],
                    c && c.style ? (b = y.createElement("div"),
                d = y.createElement("div"),
                d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px",
                c.appendChild(d).appendChild(b),
                typeof b.style.zoom !== K && (b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",
                b.appendChild(y.createElement("div")).style.width = "5px",
                a = 3 !== b.offsetWidth),
                c.removeChild(d),
                a) : void 0
        }
    }();
    var Gb = /^margin/, Hb = new RegExp("^(" + S + ")(?!px)[a-z%]+$","i"), Ib, Jb, Kb = /^(top|right|bottom|left)$/;
    a.getComputedStyle ? (Ib = function(b) {
        return b.ownerDocument.defaultView.opener ? b.ownerDocument.defaultView.getComputedStyle(b, null) : a.getComputedStyle(b, null)
    }
        ,
        Jb = function(a, b, c) {
            var d, e, f, g, h = a.style;
            return c = c || Ib(a),
                g = c ? c.getPropertyValue(b) || c[b] : void 0,
                c && ("" !== g || m.contains(a.ownerDocument, a) || (g = m.style(a, b)),
                Hb.test(g) && Gb.test(b) && (d = h.width,
                e = h.minWidth,
                f = h.maxWidth,
                h.minWidth = h.maxWidth = h.width = g,
                g = c.width,
                h.width = d,
                h.minWidth = e,
                h.maxWidth = f)),
                    void 0 === g ? g : g + ""
        }
        ) : y.documentElement.currentStyle && (Ib = function(a) {
        return a.currentStyle
    }
        ,
        Jb = function(a, b, c) {
            var d, e, f, g, h = a.style;
            return c = c || Ib(a),
                g = c ? c[b] : void 0,
                null == g && h && h[b] && (g = h[b]),
                Hb.test(g) && !Kb.test(b) && (d = h.left,
                e = a.runtimeStyle,
                f = e && e.left,
                f && (e.left = a.currentStyle.left),
                h.left = "fontSize" === b ? "1em" : g,
                g = h.pixelLeft + "px",
                h.left = d,
                f && (e.left = f)),
                    void 0 === g ? g : g + "" || "auto"
        }
        );
    function Lb(a, b) {
        return {
            get: function() {
                var c = a();
                if (null != c)
                    return c ? void delete this.get : (this.get = b).apply(this, arguments)
            }
        }
    }
    !function() {
        var b, c, d, e, f, g, h;
        if (b = y.createElement("div"),
            b.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",
            d = b.getElementsByTagName("a")[0],
            c = d && d.style) {
            c.cssText = "float:left;opacity:.5",
                k.opacity = "0.5" === c.opacity,
                k.cssFloat = !!c.cssFloat,
                b.style.backgroundClip = "content-box",
                b.cloneNode(!0).style.backgroundClip = "",
                k.clearCloneStyle = "content-box" === b.style.backgroundClip,
                k.boxSizing = "" === c.boxSizing || "" === c.MozBoxSizing || "" === c.WebkitBoxSizing,
                m.extend(k, {
                    reliableHiddenOffsets: function() {
                        return null == g && i(),
                            g
                    },
                    boxSizingReliable: function() {
                        return null == f && i(),
                            f
                    },
                    pixelPosition: function() {
                        return null == e && i(),
                            e
                    },
                    reliableMarginRight: function() {
                        return null == h && i(),
                            h
                    }
                });
            function i() {
                var b, c, d, i;
                c = y.getElementsByTagName("body")[0],
                    c && c.style && (b = y.createElement("div"),
                    d = y.createElement("div"),
                    d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px",
                    c.appendChild(d).appendChild(b),
                    b.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",
                    e = f = !1,
                    h = !0,
                    a.getComputedStyle && (e = "1%" !== (a.getComputedStyle(b, null) || {}).top,
                    f = "4px" === (a.getComputedStyle(b, null) || {
                        width: "4px"
                    }).width,
                    i = b.appendChild(y.createElement("div")),
                    i.style.cssText = b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",
                    i.style.marginRight = i.style.width = "0",
                    b.style.width = "1px",
                    h = !parseFloat((a.getComputedStyle(i, null) || {}).marginRight),
                    b.removeChild(i)),
                    b.innerHTML = "<table><tr><td></td><td>t</td></tr></table>",
                    i = b.getElementsByTagName("td"),
                    i[0].style.cssText = "margin:0;border:0;padding:0;display:none",
                    g = 0 === i[0].offsetHeight,
                    g && (i[0].style.display = "",
                    i[1].style.display = "none",
                    g = 0 === i[0].offsetHeight),
                    c.removeChild(d))
            }
        }
    }(),
        m.swap = function(a, b, c, d) {
            var e, f, g = {};
            for (f in b)
                g[f] = a.style[f],
                    a.style[f] = b[f];
            e = c.apply(a, d || []);
            for (f in b)
                a.style[f] = g[f];
            return e
        }
    ;
    var Mb = /alpha\([^)]*\)/i
        , Nb = /opacity\s*=\s*([^)]*)/
        , Ob = /^(none|table(?!-c[ea]).+)/
        , Pb = new RegExp("^(" + S + ")(.*)$","i")
        , Qb = new RegExp("^([+-])=(" + S + ")","i")
        , Rb = {
            position: "absolute",
            visibility: "hidden",
            display: "block"
        }
        , Sb = {
            letterSpacing: "0",
            fontWeight: "400"
        }
        , Tb = ["Webkit", "O", "Moz", "ms"];
    function Ub(a, b) {
        if (b in a)
            return b;
        var c = b.charAt(0).toUpperCase() + b.slice(1)
            , d = b
            , e = Tb.length;
        while (e--)
            if (b = Tb[e] + c,
                b in a)
                return b;
        return d
    }
    function Vb(a, b) {
        for (var c, d, e, f = [], g = 0, h = a.length; h > g; g++)
            d = a[g],
                d.style && (f[g] = m._data(d, "olddisplay"),
                c = d.style.display,
                b ? (f[g] || "none" !== c || (d.style.display = ""),
                    "" === d.style.display && U(d) && (f[g] = m._data(d, "olddisplay", Fb(d.nodeName)))) : (e = U(d),
                    (c && "none" !== c || !e) && m._data(d, "olddisplay", e ? c : m.css(d, "display"))));
        for (g = 0; h > g; g++)
            d = a[g],
                d.style && (b && "none" !== d.style.display && "" !== d.style.display || (d.style.display = b ? f[g] || "" : "none"));
        return a
    }
    function Wb(a, b, c) {
        var d = Pb.exec(b);
        return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b
    }
    function Xb(a, b, c, d, e) {
        for (var f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, g = 0; 4 > f; f += 2)
            "margin" === c && (g += m.css(a, c + T[f], !0, e)),
                d ? ("content" === c && (g -= m.css(a, "padding" + T[f], !0, e)),
                    "margin" !== c && (g -= m.css(a, "border" + T[f] + "Width", !0, e))) : (g += m.css(a, "padding" + T[f], !0, e),
                    "padding" !== c && (g += m.css(a, "border" + T[f] + "Width", !0, e)));
        return g
    }
    function Yb(a, b, c) {
        var d = !0
            , e = "width" === b ? a.offsetWidth : a.offsetHeight
            , f = Ib(a)
            , g = k.boxSizing && "border-box" === m.css(a, "boxSizing", !1, f);
        if (0 >= e || null == e) {
            if (e = Jb(a, b, f),
                (0 > e || null == e) && (e = a.style[b]),
                Hb.test(e))
                return e;
            d = g && (k.boxSizingReliable() || e === a.style[b]),
                e = parseFloat(e) || 0
        }
        return e + Xb(a, b, c || (g ? "border" : "content"), d, f) + "px"
    }
    m.extend({
        cssHooks: {
            opacity: {
                get: function(a, b) {
                    if (b) {
                        var c = Jb(a, "opacity");
                        return "" === c ? "1" : c
                    }
                }
            }
        },
        cssNumber: {
            columnCount: !0,
            fillOpacity: !0,
            flexGrow: !0,
            flexShrink: !0,
            fontWeight: !0,
            lineHeight: !0,
            opacity: !0,
            order: !0,
            orphans: !0,
            widows: !0,
            zIndex: !0,
            zoom: !0
        },
        cssProps: {
            "float": k.cssFloat ? "cssFloat" : "styleFloat"
        },
        style: function(a, b, c, d) {
            if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) {
                var e, f, g, h = m.camelCase(b), i = a.style;
                if (b = m.cssProps[h] || (m.cssProps[h] = Ub(i, h)),
                    g = m.cssHooks[b] || m.cssHooks[h],
                    void 0 === c)
                    return g && "get"in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b];
                if (f = typeof c,
                    "string" === f && (e = Qb.exec(c)) && (c = (e[1] + 1) * e[2] + parseFloat(m.css(a, b)),
                    f = "number"),
                    null != c && c === c && ("number" !== f || m.cssNumber[h] || (c += "px"),
                    k.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"),
                    !(g && "set"in g && void 0 === (c = g.set(a, c, d)))))
                    try {
                        i[b] = c
                    } catch (j) {}
            }
        },
        css: function(a, b, c, d) {
            var e, f, g, h = m.camelCase(b);
            return b = m.cssProps[h] || (m.cssProps[h] = Ub(a.style, h)),
                g = m.cssHooks[b] || m.cssHooks[h],
                g && "get"in g && (f = g.get(a, !0, c)),
                void 0 === f && (f = Jb(a, b, d)),
                "normal" === f && b in Sb && (f = Sb[b]),
                    "" === c || c ? (e = parseFloat(f),
                    c === !0 || m.isNumeric(e) ? e || 0 : f) : f
        }
    }),
        m.each(["height", "width"], function(a, b) {
            m.cssHooks[b] = {
                get: function(a, c, d) {
                    return c ? Ob.test(m.css(a, "display")) && 0 === a.offsetWidth ? m.swap(a, Rb, function() {
                        return Yb(a, b, d)
                    }) : Yb(a, b, d) : void 0
                },
                set: function(a, c, d) {
                    var e = d && Ib(a);
                    return Wb(a, c, d ? Xb(a, b, d, k.boxSizing && "border-box" === m.css(a, "boxSizing", !1, e), e) : 0)
                }
            }
        }),
        k.opacity || (m.cssHooks.opacity = {
        get: function(a, b) {
            return Nb.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : ""
        },
        set: function(a, b) {
            var c = a.style
                , d = a.currentStyle
                , e = m.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : ""
                , f = d && d.filter || c.filter || "";
            c.zoom = 1,
                (b >= 1 || "" === b) && "" === m.trim(f.replace(Mb, "")) && c.removeAttribute && (c.removeAttribute("filter"),
                "" === b || d && !d.filter) || (c.filter = Mb.test(f) ? f.replace(Mb, e) : f + " " + e)
        }
    }),
        m.cssHooks.marginRight = Lb(k.reliableMarginRight, function(a, b) {
            return b ? m.swap(a, {
                display: "inline-block"
            }, Jb, [a, "marginRight"]) : void 0
        }),
        m.each({
            margin: "",
            padding: "",
            border: "Width"
        }, function(a, b) {
            m.cssHooks[a + b] = {
                expand: function(c) {
                    for (var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; 4 > d; d++)
                        e[a + T[d] + b] = f[d] || f[d - 2] || f[0];
                    return e
                }
            },
                Gb.test(a) || (m.cssHooks[a + b].set = Wb)
        }),
        m.fn.extend({
            css: function(a, b) {
                return V(this, function(a, b, c) {
                    var d, e, f = {}, g = 0;
                    if (m.isArray(b)) {
                        for (d = Ib(a),
                                 e = b.length; e > g; g++)
                            f[b[g]] = m.css(a, b[g], !1, d);
                        return f
                    }
                    return void 0 !== c ? m.style(a, b, c) : m.css(a, b)
                }, a, b, arguments.length > 1)
            },
            show: function() {
                return Vb(this, !0)
            },
            hide: function() {
                return Vb(this)
            },
            toggle: function(a) {
                return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function() {
                    U(this) ? m(this).show() : m(this).hide()
                })
            }
        });
    function Zb(a, b, c, d, e) {
        return new Zb.prototype.init(a,b,c,d,e)
    }
    m.Tween = Zb,
        Zb.prototype = {
            constructor: Zb,
            init: function(a, b, c, d, e, f) {
                this.elem = a,
                    this.prop = c,
                    this.easing = e || "swing",
                    this.options = b,
                    this.start = this.now = this.cur(),
                    this.end = d,
                    this.unit = f || (m.cssNumber[c] ? "" : "px")
            },
            cur: function() {
                var a = Zb.propHooks[this.prop];
                return a && a.get ? a.get(this) : Zb.propHooks._default.get(this)
            },
            run: function(a) {
                var b, c = Zb.propHooks[this.prop];
                return this.pos = b = this.options.duration ? m.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : a,
                    this.now = (this.end - this.start) * b + this.start,
                    this.options.step && this.options.step.call(this.elem, this.now, this),
                        c && c.set ? c.set(this) : Zb.propHooks._default.set(this),
                    this
            }
        },
        Zb.prototype.init.prototype = Zb.prototype,
        Zb.propHooks = {
            _default: {
                get: function(a) {
                    var b;
                    return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = m.css(a.elem, a.prop, ""),
                            b && "auto" !== b ? b : 0) : a.elem[a.prop]
                },
                set: function(a) {
                    m.fx.step[a.prop] ? m.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[m.cssProps[a.prop]] || m.cssHooks[a.prop]) ? m.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now
                }
            }
        },
        Zb.propHooks.scrollTop = Zb.propHooks.scrollLeft = {
            set: function(a) {
                a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now)
            }
        },
        m.easing = {
            linear: function(a) {
                return a
            },
            swing: function(a) {
                return .5 - Math.cos(a * Math.PI) / 2
            }
        },
        m.fx = Zb.prototype.init,
        m.fx.step = {};
    var $b, _b, ac = /^(?:toggle|show|hide)$/, bc = new RegExp("^(?:([+-])=|)(" + S + ")([a-z%]*)$","i"), cc = /queueHooks$/, dc = [ic], ec = {
        "*": [function(a, b) {
            var c = this.createTween(a, b)
                , d = c.cur()
                , e = bc.exec(b)
                , f = e && e[3] || (m.cssNumber[a] ? "" : "px")
                , g = (m.cssNumber[a] || "px" !== f && +d) && bc.exec(m.css(c.elem, a))
                , h = 1
                , i = 20;
            if (g && g[3] !== f) {
                f = f || g[3],
                    e = e || [],
                    g = +d || 1;
                do
                    h = h || ".5",
                        g /= h,
                        m.style(c.elem, a, g + f);
                while (h !== (h = c.cur() / d) && 1 !== h && --i)
            }
            return e && (g = c.start = +g || +d || 0,
                c.unit = f,
                c.end = e[1] ? g + (e[1] + 1) * e[2] : +e[2]),
                c
        }
        ]
    };
    function fc() {
        return setTimeout(function() {
            $b = void 0
        }),
            $b = m.now()
    }
    function gc(a, b) {
        var c, d = {
            height: a
        }, e = 0;
        for (b = b ? 1 : 0; 4 > e; e += 2 - b)
            c = T[e],
                d["margin" + c] = d["padding" + c] = a;
        return b && (d.opacity = d.width = a),
            d
    }
    function hc(a, b, c) {
        for (var d, e = (ec[b] || []).concat(ec["*"]), f = 0, g = e.length; g > f; f++)
            if (d = e[f].call(c, b, a))
                return d
    }
    function ic(a, b, c) {
        var d, e, f, g, h, i, j, l, n = this, o = {}, p = a.style, q = a.nodeType && U(a), r = m._data(a, "fxshow");
        c.queue || (h = m._queueHooks(a, "fx"),
            null == h.unqueued && (h.unqueued = 0,
            i = h.empty.fire,
            h.empty.fire = function() {
                h.unqueued || i()
            }
            ),
            h.unqueued++,
            n.always(function() {
                n.always(function() {
                    h.unqueued--,
                        m.queue(a, "fx").length || h.empty.fire()
                })
            })),
            1 === a.nodeType && ("height"in b || "width"in b) && (c.overflow = [p.overflow, p.overflowX, p.overflowY],
            j = m.css(a, "display"),
            l = "none" === j ? m._data(a, "olddisplay") || Fb(a.nodeName) : j,
            "inline" === l && "none" === m.css(a, "float") && (k.inlineBlockNeedsLayout && "inline" !== Fb(a.nodeName) ? p.zoom = 1 : p.display = "inline-block")),
            c.overflow && (p.overflow = "hidden",
            k.shrinkWrapBlocks() || n.always(function() {
            p.overflow = c.overflow[0],
                p.overflowX = c.overflow[1],
                p.overflowY = c.overflow[2]
        }));
        for (d in b)
            if (e = b[d],
                ac.exec(e)) {
                if (delete b[d],
                    f = f || "toggle" === e,
                    e === (q ? "hide" : "show")) {
                    if ("show" !== e || !r || void 0 === r[d])
                        continue;
                    q = !0
                }
                o[d] = r && r[d] || m.style(a, d)
            } else
                j = void 0;
        if (m.isEmptyObject(o))
            "inline" === ("none" === j ? Fb(a.nodeName) : j) && (p.display = j);
        else {
            r ? "hidden"in r && (q = r.hidden) : r = m._data(a, "fxshow", {}),
                f && (r.hidden = !q),
                q ? m(a).show() : n.done(function() {
                    m(a).hide()
                }),
                n.done(function() {
                    var b;
                    m._removeData(a, "fxshow");
                    for (b in o)
                        m.style(a, b, o[b])
                });
            for (d in o)
                g = hc(q ? r[d] : 0, d, n),
                    d in r || (r[d] = g.start,
                    q && (g.end = g.start,
                    g.start = "width" === d || "height" === d ? 1 : 0))
        }
    }
    function jc(a, b) {
        var c, d, e, f, g;
        for (c in a)
            if (d = m.camelCase(c),
                e = b[d],
                f = a[c],
                m.isArray(f) && (e = f[1],
                f = a[c] = f[0]),
                c !== d && (a[d] = f,
                delete a[c]),
                g = m.cssHooks[d],
                g && "expand"in g) {
                f = g.expand(f),
                    delete a[d];
                for (c in f)
                    c in a || (a[c] = f[c],
                        b[c] = e)
            } else
                b[d] = e
    }
    function kc(a, b, c) {
        var d, e, f = 0, g = dc.length, h = m.Deferred().always(function() {
            delete i.elem
        }), i = function() {
            if (e)
                return !1;
            for (var b = $b || fc(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; i > g; g++)
                j.tweens[g].run(f);
            return h.notifyWith(a, [j, f, c]),
                    1 > f && i ? c : (h.resolveWith(a, [j]),
                !1)
        }, j = h.promise({
            elem: a,
            props: m.extend({}, b),
            opts: m.extend(!0, {
                specialEasing: {}
            }, c),
            originalProperties: b,
            originalOptions: c,
            startTime: $b || fc(),
            duration: c.duration,
            tweens: [],
            createTween: function(b, c) {
                var d = m.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing);
                return j.tweens.push(d),
                    d
            },
            stop: function(b) {
                var c = 0
                    , d = b ? j.tweens.length : 0;
                if (e)
                    return this;
                for (e = !0; d > c; c++)
                    j.tweens[c].run(1);
                return b ? h.resolveWith(a, [j, b]) : h.rejectWith(a, [j, b]),
                    this
            }
        }), k = j.props;
        for (jc(k, j.opts.specialEasing); g > f; f++)
            if (d = dc[f].call(j, a, k, j.opts))
                return d;
        return m.map(k, hc, j),
            m.isFunction(j.opts.start) && j.opts.start.call(a, j),
            m.fx.timer(m.extend(i, {
                elem: a,
                anim: j,
                queue: j.opts.queue
            })),
            j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always)
    }
    m.Animation = m.extend(kc, {
        tweener: function(a, b) {
            m.isFunction(a) ? (b = a,
                a = ["*"]) : a = a.split(" ");
            for (var c, d = 0, e = a.length; e > d; d++)
                c = a[d],
                    ec[c] = ec[c] || [],
                    ec[c].unshift(b)
        },
        prefilter: function(a, b) {
            b ? dc.unshift(a) : dc.push(a)
        }
    }),
        m.speed = function(a, b, c) {
            var d = a && "object" == typeof a ? m.extend({}, a) : {
                complete: c || !c && b || m.isFunction(a) && a,
                duration: a,
                easing: c && b || b && !m.isFunction(b) && b
            };
            return d.duration = m.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in m.fx.speeds ? m.fx.speeds[d.duration] : m.fx.speeds._default,
                (null == d.queue || d.queue === !0) && (d.queue = "fx"),
                d.old = d.complete,
                d.complete = function() {
                    m.isFunction(d.old) && d.old.call(this),
                        d.queue && m.dequeue(this, d.queue)
                }
                ,
                d
        }
        ,
        m.fn.extend({
            fadeTo: function(a, b, c, d) {
                return this.filter(U).css("opacity", 0).show().end().animate({
                    opacity: b
                }, a, c, d)
            },
            animate: function(a, b, c, d) {
                var e = m.isEmptyObject(a)
                    , f = m.speed(b, c, d)
                    , g = function() {
                        var b = kc(this, m.extend({}, a), f);
                        (e || m._data(this, "finish")) && b.stop(!0)
                    };
                return g.finish = g,
                        e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g)
            },
            stop: function(a, b, c) {
                var d = function(a) {
                    var b = a.stop;
                    delete a.stop,
                        b(c)
                };
                return "string" != typeof a && (c = b,
                    b = a,
                    a = void 0),
                    b && a !== !1 && this.queue(a || "fx", []),
                    this.each(function() {
                        var b = !0
                            , e = null != a && a + "queueHooks"
                            , f = m.timers
                            , g = m._data(this);
                        if (e)
                            g[e] && g[e].stop && d(g[e]);
                        else
                            for (e in g)
                                g[e] && g[e].stop && cc.test(e) && d(g[e]);
                        for (e = f.length; e--; )
                            f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c),
                                b = !1,
                                f.splice(e, 1));
                        (b || !c) && m.dequeue(this, a)
                    })
            },
            finish: function(a) {
                return a !== !1 && (a = a || "fx"),
                    this.each(function() {
                        var b, c = m._data(this), d = c[a + "queue"], e = c[a + "queueHooks"], f = m.timers, g = d ? d.length : 0;
                        for (c.finish = !0,
                                 m.queue(this, a, []),
                                 e && e.stop && e.stop.call(this, !0),
                                 b = f.length; b--; )
                            f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0),
                                f.splice(b, 1));
                        for (b = 0; g > b; b++)
                            d[b] && d[b].finish && d[b].finish.call(this);
                        delete c.finish
                    })
            }
        }),
        m.each(["toggle", "show", "hide"], function(a, b) {
            var c = m.fn[b];
            m.fn[b] = function(a, d, e) {
                return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(gc(b, !0), a, d, e)
            }
        }),
        m.each({
            slideDown: gc("show"),
            slideUp: gc("hide"),
            slideToggle: gc("toggle"),
            fadeIn: {
                opacity: "show"
            },
            fadeOut: {
                opacity: "hide"
            },
            fadeToggle: {
                opacity: "toggle"
            }
        }, function(a, b) {
            m.fn[a] = function(a, c, d) {
                return this.animate(b, a, c, d)
            }
        }),
        m.timers = [],
        m.fx.tick = function() {
            var a, b = m.timers, c = 0;
            for ($b = m.now(); c < b.length; c++)
                a = b[c],
                    a() || b[c] !== a || b.splice(c--, 1);
            b.length || m.fx.stop(),
                $b = void 0
        }
        ,
        m.fx.timer = function(a) {
            m.timers.push(a),
                a() ? m.fx.start() : m.timers.pop()
        }
        ,
        m.fx.interval = 13,
        m.fx.start = function() {
            _b || (_b = setInterval(m.fx.tick, m.fx.interval))
        }
        ,
        m.fx.stop = function() {
            clearInterval(_b),
                _b = null
        }
        ,
        m.fx.speeds = {
            slow: 600,
            fast: 200,
            _default: 400
        },
        m.fn.delay = function(a, b) {
            return a = m.fx ? m.fx.speeds[a] || a : a,
                b = b || "fx",
                this.queue(b, function(b, c) {
                    var d = setTimeout(b, a);
                    c.stop = function() {
                        clearTimeout(d)
                    }
                })
        }
        ,
        function() {
            var a, b, c, d, e;
            b = y.createElement("div"),
                b.setAttribute("className", "t"),
                b.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",
                d = b.getElementsByTagName("a")[0],
                c = y.createElement("select"),
                e = c.appendChild(y.createElement("option")),
                a = b.getElementsByTagName("input")[0],
                d.style.cssText = "top:1px",
                k.getSetAttribute = "t" !== b.className,
                k.style = /top/.test(d.getAttribute("style")),
                k.hrefNormalized = "/a" === d.getAttribute("href"),
                k.checkOn = !!a.value,
                k.optSelected = e.selected,
                k.enctype = !!y.createElement("form").enctype,
                c.disabled = !0,
                k.optDisabled = !e.disabled,
                a = y.createElement("input"),
                a.setAttribute("value", ""),
                k.input = "" === a.getAttribute("value"),
                a.value = "t",
                a.setAttribute("type", "radio"),
                k.radioValue = "t" === a.value
        }();
    var lc = /\r/g;
    m.fn.extend({
        val: function(a) {
            var b, c, d, e = this[0];
            {
                if (arguments.length)
                    return d = m.isFunction(a),
                        this.each(function(c) {
                            var e;
                            1 === this.nodeType && (e = d ? a.call(this, c, m(this).val()) : a,
                                    null == e ? e = "" : "number" == typeof e ? e += "" : m.isArray(e) && (e = m.map(e, function(a) {
                                return null == a ? "" : a + ""
                            })),
                                b = m.valHooks[this.type] || m.valHooks[this.nodeName.toLowerCase()],
                                b && "set"in b && void 0 !== b.set(this, e, "value") || (this.value = e))
                        });
                if (e)
                    return b = m.valHooks[e.type] || m.valHooks[e.nodeName.toLowerCase()],
                            b && "get"in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value,
                            "string" == typeof c ? c.replace(lc, "") : null == c ? "" : c)
            }
        }
    }),
        m.extend({
            valHooks: {
                option: {
                    get: function(a) {
                        var b = m.find.attr(a, "value");
                        return null != b ? b : m.trim(m.text(a))
                    }
                },
                select: {
                    get: function(a) {
                        for (var b, c, d = a.options, e = a.selectedIndex, f = "select-one" === a.type || 0 > e, g = f ? null : [], h = f ? e + 1 : d.length, i = 0 > e ? h : f ? e : 0; h > i; i++)
                            if (c = d[i],
                                !(!c.selected && i !== e || (k.optDisabled ? c.disabled : null !== c.getAttribute("disabled")) || c.parentNode.disabled && m.nodeName(c.parentNode, "optgroup"))) {
                                if (b = m(c).val(),
                                    f)
                                    return b;
                                g.push(b)
                            }
                        return g
                    },
                    set: function(a, b) {
                        var c, d, e = a.options, f = m.makeArray(b), g = e.length;
                        while (g--)
                            if (d = e[g],
                                m.inArray(m.valHooks.option.get(d), f) >= 0)
                                try {
                                    d.selected = c = !0
                                } catch (h) {
                                    d.scrollHeight
                                }
                            else
                                d.selected = !1;
                        return c || (a.selectedIndex = -1),
                            e
                    }
                }
            }
        }),
        m.each(["radio", "checkbox"], function() {
            m.valHooks[this] = {
                set: function(a, b) {
                    return m.isArray(b) ? a.checked = m.inArray(m(a).val(), b) >= 0 : void 0
                }
            },
                k.checkOn || (m.valHooks[this].get = function(a) {
                return null === a.getAttribute("value") ? "on" : a.value
            }
                )
        });
    var mc, nc, oc = m.expr.attrHandle, pc = /^(?:checked|selected)$/i, qc = k.getSetAttribute, rc = k.input;
    m.fn.extend({
        attr: function(a, b) {
            return V(this, m.attr, a, b, arguments.length > 1)
        },
        removeAttr: function(a) {
            return this.each(function() {
                m.removeAttr(this, a)
            })
        }
    }),
        m.extend({
            attr: function(a, b, c) {
                var d, e, f = a.nodeType;
                if (a && 3 !== f && 8 !== f && 2 !== f)
                    return typeof a.getAttribute === K ? m.prop(a, b, c) : (1 === f && m.isXMLDoc(a) || (b = b.toLowerCase(),
                        d = m.attrHooks[b] || (m.expr.match.bool.test(b) ? nc : mc)),
                            void 0 === c ? d && "get"in d && null !== (e = d.get(a, b)) ? e : (e = m.find.attr(a, b),
                            null == e ? void 0 : e) : null !== c ? d && "set"in d && void 0 !== (e = d.set(a, c, b)) ? e : (a.setAttribute(b, c + ""),
                        c) : void m.removeAttr(a, b))
            },
            removeAttr: function(a, b) {
                var c, d, e = 0, f = b && b.match(E);
                if (f && 1 === a.nodeType)
                    while (c = f[e++])
                        d = m.propFix[c] || c,
                            m.expr.match.bool.test(c) ? rc && qc || !pc.test(c) ? a[d] = !1 : a[m.camelCase("default-" + c)] = a[d] = !1 : m.attr(a, c, ""),
                            a.removeAttribute(qc ? c : d)
            },
            attrHooks: {
                type: {
                    set: function(a, b) {
                        if (!k.radioValue && "radio" === b && m.nodeName(a, "input")) {
                            var c = a.value;
                            return a.setAttribute("type", b),
                                c && (a.value = c),
                                b
                        }
                    }
                }
            }
        }),
        nc = {
            set: function(a, b, c) {
                return b === !1 ? m.removeAttr(a, c) : rc && qc || !pc.test(c) ? a.setAttribute(!qc && m.propFix[c] || c, c) : a[m.camelCase("default-" + c)] = a[c] = !0,
                    c
            }
        },
        m.each(m.expr.match.bool.source.match(/\w+/g), function(a, b) {
            var c = oc[b] || m.find.attr;
            oc[b] = rc && qc || !pc.test(b) ? function(a, b, d) {
                var e, f;
                return d || (f = oc[b],
                    oc[b] = e,
                    e = null != c(a, b, d) ? b.toLowerCase() : null,
                    oc[b] = f),
                    e
            }
                : function(a, b, c) {
                return c ? void 0 : a[m.camelCase("default-" + b)] ? b.toLowerCase() : null
            }
        }),
        rc && qc || (m.attrHooks.value = {
        set: function(a, b, c) {
            return m.nodeName(a, "input") ? void (a.defaultValue = b) : mc && mc.set(a, b, c)
        }
    }),
        qc || (mc = {
        set: function(a, b, c) {
            var d = a.getAttributeNode(c);
            return d || a.setAttributeNode(d = a.ownerDocument.createAttribute(c)),
                d.value = b += "",
                    "value" === c || b === a.getAttribute(c) ? b : void 0
        }
    },
        oc.id = oc.name = oc.coords = function(a, b, c) {
            var d;
            return c ? void 0 : (d = a.getAttributeNode(b)) && "" !== d.value ? d.value : null
        }
        ,
        m.valHooks.button = {
            get: function(a, b) {
                var c = a.getAttributeNode(b);
                return c && c.specified ? c.value : void 0
            },
            set: mc.set
        },
        m.attrHooks.contenteditable = {
            set: function(a, b, c) {
                mc.set(a, "" === b ? !1 : b, c)
            }
        },
        m.each(["width", "height"], function(a, b) {
            m.attrHooks[b] = {
                set: function(a, c) {
                    return "" === c ? (a.setAttribute(b, "auto"),
                        c) : void 0
                }
            }
        })),
        k.style || (m.attrHooks.style = {
        get: function(a) {
            return a.style.cssText || void 0
        },
        set: function(a, b) {
            return a.style.cssText = b + ""
        }
    });
    var sc = /^(?:input|select|textarea|button|object)$/i
        , tc = /^(?:a|area)$/i;
    m.fn.extend({
        prop: function(a, b) {
            return V(this, m.prop, a, b, arguments.length > 1)
        },
        removeProp: function(a) {
            return a = m.propFix[a] || a,
                this.each(function() {
                    try {
                        this[a] = void 0,
                            delete this[a]
                    } catch (b) {}
                })
        }
    }),
        m.extend({
            propFix: {
                "for": "htmlFor",
                "class": "className"
            },
            prop: function(a, b, c) {
                var d, e, f, g = a.nodeType;
                if (a && 3 !== g && 8 !== g && 2 !== g)
                    return f = 1 !== g || !m.isXMLDoc(a),
                        f && (b = m.propFix[b] || b,
                        e = m.propHooks[b]),
                            void 0 !== c ? e && "set"in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get"in e && null !== (d = e.get(a, b)) ? d : a[b]
            },
            propHooks: {
                tabIndex: {
                    get: function(a) {
                        var b = m.find.attr(a, "tabindex");
                        return b ? parseInt(b, 10) : sc.test(a.nodeName) || tc.test(a.nodeName) && a.href ? 0 : -1
                    }
                }
            }
        }),
        k.hrefNormalized || m.each(["href", "src"], function(a, b) {
        m.propHooks[b] = {
            get: function(a) {
                return a.getAttribute(b, 4)
            }
        }
    }),
        k.optSelected || (m.propHooks.selected = {
        get: function(a) {
            var b = a.parentNode;
            return b && (b.selectedIndex,
                b.parentNode && b.parentNode.selectedIndex),
                null
        }
    }),
        m.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
            m.propFix[this.toLowerCase()] = this
        }),
        k.enctype || (m.propFix.enctype = "encoding");
    var uc = /[\t\r\n\f]/g;
    m.fn.extend({
        addClass: function(a) {
            var b, c, d, e, f, g, h = 0, i = this.length, j = "string" == typeof a && a;
            if (m.isFunction(a))
                return this.each(function(b) {
                    m(this).addClass(a.call(this, b, this.className))
                });
            if (j)
                for (b = (a || "").match(E) || []; i > h; h++)
                    if (c = this[h],
                        d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(uc, " ") : " ")) {
                        f = 0;
                        while (e = b[f++])
                            d.indexOf(" " + e + " ") < 0 && (d += e + " ");
                        g = m.trim(d),
                            c.className !== g && (c.className = g)
                    }
            return this
        },
        removeClass: function(a) {
            var b, c, d, e, f, g, h = 0, i = this.length, j = 0 === arguments.length || "string" == typeof a && a;
            if (m.isFunction(a))
                return this.each(function(b) {
                    m(this).removeClass(a.call(this, b, this.className))
                });
            if (j)
                for (b = (a || "").match(E) || []; i > h; h++)
                    if (c = this[h],
                        d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(uc, " ") : "")) {
                        f = 0;
                        while (e = b[f++])
                            while (d.indexOf(" " + e + " ") >= 0)
                                d = d.replace(" " + e + " ", " ");
                        g = a ? m.trim(d) : "",
                            c.className !== g && (c.className = g)
                    }
            return this
        },
        toggleClass: function(a, b) {
            var c = typeof a;
            return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : this.each(m.isFunction(a) ? function(c) {
                    m(this).toggleClass(a.call(this, c, this.className, b), b)
                }
                    : function() {
                    if ("string" === c) {
                        var b, d = 0, e = m(this), f = a.match(E) || [];
                        while (b = f[d++])
                            e.hasClass(b) ? e.removeClass(b) : e.addClass(b)
                    } else
                        (c === K || "boolean" === c) && (this.className && m._data(this, "__className__", this.className),
                            this.className = this.className || a === !1 ? "" : m._data(this, "__className__") || "")
                }
            )
        },
        hasClass: function(a) {
            for (var b = " " + a + " ", c = 0, d = this.length; d > c; c++)
                if (1 === this[c].nodeType && (" " + this[c].className + " ").replace(uc, " ").indexOf(b) >= 0)
                    return !0;
            return !1
        }
    }),
        m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(a, b) {
            m.fn[b] = function(a, c) {
                return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b)
            }
        }),
        m.fn.extend({
            hover: function(a, b) {
                return this.mouseenter(a).mouseleave(b || a)
            },
            bind: function(a, b, c) {
                return this.on(a, null, b, c)
            },
            unbind: function(a, b) {
                return this.off(a, null, b)
            },
            delegate: function(a, b, c, d) {
                return this.on(b, a, c, d)
            },
            undelegate: function(a, b, c) {
                return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c)
            }
        });
    var vc = m.now()
        , wc = /\?/
        , xc = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
    m.parseJSON = function(b) {
        if (a.JSON && a.JSON.parse)
            return a.JSON.parse(b + "");
        var c, d = null, e = m.trim(b + "");
        return e && !m.trim(e.replace(xc, function(a, b, e, f) {
            return c && b && (d = 0),
                    0 === d ? a : (c = e || b,
                d += !f - !e,
                "")
        })) ? Function("return " + e)() : m.error("Invalid JSON: " + b)
    }
        ,
        m.parseXML = function(b) {
            var c, d;
            if (!b || "string" != typeof b)
                return null;
            try {
                a.DOMParser ? (d = new DOMParser,
                    c = d.parseFromString(b, "text/xml")) : (c = new ActiveXObject("Microsoft.XMLDOM"),
                    c.async = "false",
                    c.loadXML(b))
            } catch (e) {
                c = void 0
            }
            return c && c.documentElement && !c.getElementsByTagName("parsererror").length || m.error("Invalid XML: " + b),
                c
        }
    ;
    var yc, zc, Ac = /#.*$/, Bc = /([?&])_=[^&]*/, Cc = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, Dc = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, Ec = /^(?:GET|HEAD)$/, Fc = /^\/\//, Gc = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, Hc = {}, Ic = {}, Jc = "*/".concat("*");
    try {
        zc = location.href
    } catch (Kc) {
        zc = y.createElement("a"),
            zc.href = "",
            zc = zc.href
    }
    yc = Gc.exec(zc.toLowerCase()) || [];
    function Lc(a) {
        return function(b, c) {
            "string" != typeof b && (c = b,
                b = "*");
            var d, e = 0, f = b.toLowerCase().match(E) || [];
            if (m.isFunction(c))
                while (d = f[e++])
                    "+" === d.charAt(0) ? (d = d.slice(1) || "*",
                        (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c)
        }
    }
    function Mc(a, b, c, d) {
        var e = {}
            , f = a === Ic;
        function g(h) {
            var i;
            return e[h] = !0,
                m.each(a[h] || [], function(a, h) {
                    var j = h(b, c, d);
                    return "string" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j),
                        g(j),
                        !1)
                }),
                i
        }
        return g(b.dataTypes[0]) || !e["*"] && g("*")
    }
    function Nc(a, b) {
        var c, d, e = m.ajaxSettings.flatOptions || {};
        for (d in b)
            void 0 !== b[d] && ((e[d] ? a : c || (c = {}))[d] = b[d]);
        return c && m.extend(!0, a, c),
            a
    }
    function Oc(a, b, c) {
        var d, e, f, g, h = a.contents, i = a.dataTypes;
        while ("*" === i[0])
            i.shift(),
                void 0 === e && (e = a.mimeType || b.getResponseHeader("Content-Type"));
        if (e)
            for (g in h)
                if (h[g] && h[g].test(e)) {
                    i.unshift(g);
                    break
                }
        if (i[0]in c)
            f = i[0];
        else {
            for (g in c) {
                if (!i[0] || a.converters[g + " " + i[0]]) {
                    f = g;
                    break
                }
                d || (d = g)
            }
            f = f || d
        }
        return f ? (f !== i[0] && i.unshift(f),
            c[f]) : void 0
    }
    function Pc(a, b, c, d) {
        var e, f, g, h, i, j = {}, k = a.dataTypes.slice();
        if (k[1])
            for (g in a.converters)
                j[g.toLowerCase()] = a.converters[g];
        f = k.shift();
        while (f)
            if (a.responseFields[f] && (c[a.responseFields[f]] = b),
                !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)),
                i = f,
                f = k.shift())
                if ("*" === f)
                    f = i;
                else if ("*" !== i && i !== f) {
                    if (g = j[i + " " + f] || j["* " + f],
                        !g)
                        for (e in j)
                            if (h = e.split(" "),
                                h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) {
                                g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0],
                                    k.unshift(h[1]));
                                break
                            }
                    if (g !== !0)
                        if (g && a["throws"])
                            b = g(b);
                        else
                            try {
                                b = g(b)
                            } catch (l) {
                                return {
                                    state: "parsererror",
                                    error: g ? l : "No conversion from " + i + " to " + f
                                }
                            }
                }
        return {
            state: "success",
            data: b
        }
    }
    m.extend({
        active: 0,
        lastModified: {},
        etag: {},
        ajaxSettings: {
            url: zc,
            type: "GET",
            isLocal: Dc.test(yc[1]),
            global: !0,
            processData: !0,
            async: !0,
            contentType: "application/x-www-form-urlencoded; charset=UTF-8",
            accepts: {
                "*": Jc,
                text: "text/plain",
                html: "text/html",
                xml: "application/xml, text/xml",
                json: "application/json, text/javascript"
            },
            contents: {
                xml: /xml/,
                html: /html/,
                json: /json/
            },
            responseFields: {
                xml: "responseXML",
                text: "responseText",
                json: "responseJSON"
            },
            converters: {
                "* text": String,
                "text html": !0,
                "text json": m.parseJSON,
                "text xml": m.parseXML
            },
            flatOptions: {
                url: !0,
                context: !0
            }
        },
        ajaxSetup: function(a, b) {
            return b ? Nc(Nc(a, m.ajaxSettings), b) : Nc(m.ajaxSettings, a)
        },
        ajaxPrefilter: Lc(Hc),
        ajaxTransport: Lc(Ic),
        ajax: function(a, b) {
            "object" == typeof a && (b = a,
                a = void 0),
                b = b || {};
            var c, d, e, f, g, h, i, j, k = m.ajaxSetup({}, b), l = k.context || k, n = k.context && (l.nodeType || l.jquery) ? m(l) : m.event, o = m.Deferred(), p = m.Callbacks("once memory"), q = k.statusCode || {}, r = {}, s = {}, t = 0, u = "canceled", v = {
                readyState: 0,
                getResponseHeader: function(a) {
                    var b;
                    if (2 === t) {
                        if (!j) {
                            j = {};
                            while (b = Cc.exec(f))
                                j[b[1].toLowerCase()] = b[2]
                        }
                        b = j[a.toLowerCase()]
                    }
                    return null == b ? null : b
                },
                getAllResponseHeaders: function() {
                    return 2 === t ? f : null
                },
                setRequestHeader: function(a, b) {
                    var c = a.toLowerCase();
                    return t || (a = s[c] = s[c] || a,
                        r[a] = b),
                        this
                },
                overrideMimeType: function(a) {
                    return t || (k.mimeType = a),
                        this
                },
                statusCode: function(a) {
                    var b;
                    if (a)
                        if (2 > t)
                            for (b in a)
                                q[b] = [q[b], a[b]];
                        else
                            v.always(a[v.status]);
                    return this
                },
                abort: function(a) {
                    var b = a || u;
                    return i && i.abort(b),
                        x(0, b),
                        this
                }
            };
            if (o.promise(v).complete = p.add,
                v.success = v.done,
                v.error = v.fail,
                k.url = ((a || k.url || zc) + "").replace(Ac, "").replace(Fc, yc[1] + "//"),
                k.type = b.method || b.type || k.method || k.type,
                k.dataTypes = m.trim(k.dataType || "*").toLowerCase().match(E) || [""],
                null == k.crossDomain && (c = Gc.exec(k.url.toLowerCase()),
                k.crossDomain = !(!c || c[1] === yc[1] && c[2] === yc[2] && (c[3] || ("http:" === c[1] ? "80" : "443")) === (yc[3] || ("http:" === yc[1] ? "80" : "443")))),
                k.data && k.processData && "string" != typeof k.data && (k.data = m.param(k.data, k.traditional)),
                Mc(Hc, k, b, v),
                2 === t)
                return v;
            h = m.event && k.global,
                h && 0 === m.active++ && m.event.trigger("ajaxStart"),
                k.type = k.type.toUpperCase(),
                k.hasContent = !Ec.test(k.type),
                e = k.url,
                k.hasContent || (k.data && (e = k.url += (wc.test(e) ? "&" : "?") + k.data,
                delete k.data),
                k.cache === !1 && (k.url = Bc.test(e) ? e.replace(Bc, "$1_=" + vc++) : e + (wc.test(e) ? "&" : "?") + "_=" + vc++)),
                k.ifModified && (m.lastModified[e] && v.setRequestHeader("If-Modified-Since", m.lastModified[e]),
                m.etag[e] && v.setRequestHeader("If-None-Match", m.etag[e])),
                (k.data && k.hasContent && k.contentType !== !1 || b.contentType) && v.setRequestHeader("Content-Type", k.contentType),
                v.setRequestHeader("Accept", k.dataTypes[0] && k.accepts[k.dataTypes[0]] ? k.accepts[k.dataTypes[0]] + ("*" !== k.dataTypes[0] ? ", " + Jc + "; q=0.01" : "") : k.accepts["*"]);
            for (d in k.headers)
                v.setRequestHeader(d, k.headers[d]);
            if (k.beforeSend && (k.beforeSend.call(l, v, k) === !1 || 2 === t))
                return v.abort();
            u = "abort";
            for (d in {
                success: 1,
                error: 1,
                complete: 1
            })
                v[d](k[d]);
            if (i = Mc(Ic, k, b, v)) {
                v.readyState = 1,
                    h && n.trigger("ajaxSend", [v, k]),
                    k.async && k.timeout > 0 && (g = setTimeout(function() {
                    v.abort("timeout")
                }, k.timeout));
                try {
                    t = 1,
                        i.send(r, x)
                } catch (w) {
                    if (!(2 > t))
                        throw w;
                    x(-1, w)
                }
            } else
                x(-1, "No Transport");
            function x(a, b, c, d) {
                var j, r, s, u, w, x = b;
                2 !== t && (t = 2,
                    g && clearTimeout(g),
                    i = void 0,
                    f = d || "",
                    v.readyState = a > 0 ? 4 : 0,
                    j = a >= 200 && 300 > a || 304 === a,
                    c && (u = Oc(k, v, c)),
                    u = Pc(k, u, v, j),
                    j ? (k.ifModified && (w = v.getResponseHeader("Last-Modified"),
                        w && (m.lastModified[e] = w),
                        w = v.getResponseHeader("etag"),
                        w && (m.etag[e] = w)),
                            204 === a || "HEAD" === k.type ? x = "nocontent" : 304 === a ? x = "notmodified" : (x = u.state,
                        r = u.data,
                        s = u.error,
                        j = !s)) : (s = x,
                        (a || !x) && (x = "error",
                        0 > a && (a = 0))),
                    v.status = a,
                    v.statusText = (b || x) + "",
                    j ? o.resolveWith(l, [r, x, v]) : o.rejectWith(l, [v, x, s]),
                    v.statusCode(q),
                    q = void 0,
                    h && n.trigger(j ? "ajaxSuccess" : "ajaxError", [v, k, j ? r : s]),
                    p.fireWith(l, [v, x]),
                    h && (n.trigger("ajaxComplete", [v, k]),
                    --m.active || m.event.trigger("ajaxStop")))
            }
            return v
        },
        getJSON: function(a, b, c) {
            return m.get(a, b, c, "json")
        },
        getScript: function(a, b) {
            return m.get(a, void 0, b, "script")
        }
    }),
        m.each(["get", "post"], function(a, b) {
            m[b] = function(a, c, d, e) {
                return m.isFunction(c) && (e = e || d,
                    d = c,
                    c = void 0),
                    m.ajax({
                        url: a,
                        type: b,
                        dataType: e,
                        data: c,
                        success: d
                    })
            }
        }),
        m._evalUrl = function(a) {
            return m.ajax({
                url: a,
                type: "GET",
                dataType: "script",
                async: !1,
                global: !1,
                "throws": !0
            })
        }
        ,
        m.fn.extend({
            wrapAll: function(a) {
                if (m.isFunction(a))
                    return this.each(function(b) {
                        m(this).wrapAll(a.call(this, b))
                    });
                if (this[0]) {
                    var b = m(a, this[0].ownerDocument).eq(0).clone(!0);
                    this[0].parentNode && b.insertBefore(this[0]),
                        b.map(function() {
                            var a = this;
                            while (a.firstChild && 1 === a.firstChild.nodeType)
                                a = a.firstChild;
                            return a
                        }).append(this)
                }
                return this
            },
            wrapInner: function(a) {
                return this.each(m.isFunction(a) ? function(b) {
                        m(this).wrapInner(a.call(this, b))
                    }
                        : function() {
                        var b = m(this)
                            , c = b.contents();
                        c.length ? c.wrapAll(a) : b.append(a)
                    }
                )
            },
            wrap: function(a) {
                var b = m.isFunction(a);
                return this.each(function(c) {
                    m(this).wrapAll(b ? a.call(this, c) : a)
                })
            },
            unwrap: function() {
                return this.parent().each(function() {
                    m.nodeName(this, "body") || m(this).replaceWith(this.childNodes)
                }).end()
            }
        }),
        m.expr.filters.hidden = function(a) {
            return a.offsetWidth <= 0 && a.offsetHeight <= 0 || !k.reliableHiddenOffsets() && "none" === (a.style && a.style.display || m.css(a, "display"))
        }
        ,
        m.expr.filters.visible = function(a) {
            return !m.expr.filters.hidden(a)
        }
    ;
    var Qc = /%20/g
        , Rc = /\[\]$/
        , Sc = /\r?\n/g
        , Tc = /^(?:submit|button|image|reset|file)$/i
        , Uc = /^(?:input|select|textarea|keygen)/i;
    function Vc(a, b, c, d) {
        var e;
        if (m.isArray(b))
            m.each(b, function(b, e) {
                c || Rc.test(a) ? d(a, e) : Vc(a + "[" + ("object" == typeof e ? b : "") + "]", e, c, d)
            });
        else if (c || "object" !== m.type(b))
            d(a, b);
        else
            for (e in b)
                Vc(a + "[" + e + "]", b[e], c, d)
    }
    m.param = function(a, b) {
        var c, d = [], e = function(a, b) {
            b = m.isFunction(b) ? b() : null == b ? "" : b,
                d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b)
        };
        if (void 0 === b && (b = m.ajaxSettings && m.ajaxSettings.traditional),
            m.isArray(a) || a.jquery && !m.isPlainObject(a))
            m.each(a, function() {
                e(this.name, this.value)
            });
        else
            for (c in a)
                Vc(c, a[c], b, e);
        return d.join("&").replace(Qc, "+")
    }
        ,
        m.fn.extend({
            serialize: function() {
                return m.param(this.serializeArray())
            },
            serializeArray: function() {
                return this.map(function() {
                    var a = m.prop(this, "elements");
                    return a ? m.makeArray(a) : this
                }).filter(function() {
                    var a = this.type;
                    return this.name && !m(this).is(":disabled") && Uc.test(this.nodeName) && !Tc.test(a) && (this.checked || !W.test(a))
                }).map(function(a, b) {
                    var c = m(this).val();
                    return null == c ? null : m.isArray(c) ? m.map(c, function(a) {
                        return {
                            name: b.name,
                            value: a.replace(Sc, "\r\n")
                        }
                    }) : {
                        name: b.name,
                        value: c.replace(Sc, "\r\n")
                    }
                }).get()
            }
        }),
        m.ajaxSettings.xhr = void 0 !== a.ActiveXObject ? function() {
            return !this.isLocal && /^(get|post|head|put|delete|options)$/i.test(this.type) && Zc() || $c()
        }
            : Zc;
    var Wc = 0
        , Xc = {}
        , Yc = m.ajaxSettings.xhr();
    a.attachEvent && a.attachEvent("onunload", function() {
        for (var a in Xc)
            Xc[a](void 0, !0)
    }),
        k.cors = !!Yc && "withCredentials"in Yc,
        Yc = k.ajax = !!Yc,
        Yc && m.ajaxTransport(function(a) {
        if (!a.crossDomain || k.cors) {
            var b;
            return {
                send: function(c, d) {
                    var e, f = a.xhr(), g = ++Wc;
                    if (f.open(a.type, a.url, a.async, a.username, a.password),
                        a.xhrFields)
                        for (e in a.xhrFields)
                            f[e] = a.xhrFields[e];
                    a.mimeType && f.overrideMimeType && f.overrideMimeType(a.mimeType),
                        a.crossDomain || c["X-Requested-With"] || (c["X-Requested-With"] = "XMLHttpRequest");
                    for (e in c)
                        void 0 !== c[e] && f.setRequestHeader(e, c[e] + "");
                    f.send(a.hasContent && a.data || null),
                        b = function(c, e) {
                            var h, i, j;
                            if (b && (e || 4 === f.readyState))
                                if (delete Xc[g],
                                    b = void 0,
                                    f.onreadystatechange = m.noop,
                                    e)
                                    4 !== f.readyState && f.abort();
                                else {
                                    j = {},
                                        h = f.status,
                                        "string" == typeof f.responseText && (j.text = f.responseText);
                                    try {
                                        i = f.statusText
                                    } catch (k) {
                                        i = ""
                                    }
                                    h || !a.isLocal || a.crossDomain ? 1223 === h && (h = 204) : h = j.text ? 200 : 404
                                }
                            j && d(h, i, j, f.getAllResponseHeaders())
                        }
                        ,
                        a.async ? 4 === f.readyState ? setTimeout(b) : f.onreadystatechange = Xc[g] = b : b()
                },
                abort: function() {
                    b && b(void 0, !0)
                }
            }
        }
    });
    function Zc() {
        try {
            return new a.XMLHttpRequest
        } catch (b) {}
    }
    function $c() {
        try {
            return new a.ActiveXObject("Microsoft.XMLHTTP")
        } catch (b) {}
    }
    m.ajaxSetup({
        accepts: {
            script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
        },
        contents: {
            script: /(?:java|ecma)script/
        },
        converters: {
            "text script": function(a) {
                return m.globalEval(a),
                    a
            }
        }
    }),
        m.ajaxPrefilter("script", function(a) {
            void 0 === a.cache && (a.cache = !1),
                a.crossDomain && (a.type = "GET",
                a.global = !1)
        }),
        m.ajaxTransport("script", function(a) {
            if (a.crossDomain) {
                var b, c = y.head || m("head")[0] || y.documentElement;
                return {
                    send: function(d, e) {
                        b = y.createElement("script"),
                            b.async = !0,
                            a.scriptCharset && (b.charset = a.scriptCharset),
                            b.src = a.url,
                            b.onload = b.onreadystatechange = function(a, c) {
                                (c || !b.readyState || /loaded|complete/.test(b.readyState)) && (b.onload = b.onreadystatechange = null,
                                    b.parentNode && b.parentNode.removeChild(b),
                                    b = null,
                                    c || e(200, "success"))
                            }
                            ,
                            c.insertBefore(b, c.firstChild)
                    },
                    abort: function() {
                        b && b.onload(void 0, !0)
                    }
                }
            }
        });
    var _c = []
        , ad = /(=)\?(?=&|$)|\?\?/;
    m.ajaxSetup({
        jsonp: "callback",
        jsonpCallback: function() {
            var a = _c.pop() || m.expando + "_" + vc++;
            return this[a] = !0,
                a
        }
    }),
        m.ajaxPrefilter("json jsonp", function(b, c, d) {
            var e, f, g, h = b.jsonp !== !1 && (ad.test(b.url) ? "url" : "string" == typeof b.data && !(b.contentType || "").indexOf("application/x-www-form-urlencoded") && ad.test(b.data) && "data");
            return h || "jsonp" === b.dataTypes[0] ? (e = b.jsonpCallback = m.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback,
                h ? b[h] = b[h].replace(ad, "$1" + e) : b.jsonp !== !1 && (b.url += (wc.test(b.url) ? "&" : "?") + b.jsonp + "=" + e),
                b.converters["script json"] = function() {
                    return g || m.error(e + " was not called"),
                        g[0]
                }
                ,
                b.dataTypes[0] = "json",
                f = a[e],
                a[e] = function() {
                    g = arguments
                }
                ,
                d.always(function() {
                    a[e] = f,
                        b[e] && (b.jsonpCallback = c.jsonpCallback,
                        _c.push(e)),
                        g && m.isFunction(f) && f(g[0]),
                        g = f = void 0
                }),
                "script") : void 0
        }),
        m.parseHTML = function(a, b, c) {
            if (!a || "string" != typeof a)
                return null;
            "boolean" == typeof b && (c = b,
                b = !1),
                b = b || y;
            var d = u.exec(a)
                , e = !c && [];
            return d ? [b.createElement(d[1])] : (d = m.buildFragment([a], b, e),
                e && e.length && m(e).remove(),
                m.merge([], d.childNodes))
        }
    ;
    var bd = m.fn.load;
    m.fn.load = function(a, b, c) {
        if ("string" != typeof a && bd)
            return bd.apply(this, arguments);
        var d, e, f, g = this, h = a.indexOf(" ");
        return h >= 0 && (d = m.trim(a.slice(h, a.length)),
            a = a.slice(0, h)),
            m.isFunction(b) ? (c = b,
                b = void 0) : b && "object" == typeof b && (f = "POST"),
            g.length > 0 && m.ajax({
            url: a,
            type: f,
            dataType: "html",
            data: b
        }).done(function(a) {
            e = arguments,
                g.html(d ? m("<div>").append(m.parseHTML(a)).find(d) : a)
        }).complete(c && function(a, b) {
                g.each(c, e || [a.responseText, b, a])
            }
        ),
            this
    }
        ,
        m.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(a, b) {
            m.fn[b] = function(a) {
                return this.on(b, a)
            }
        }),
        m.expr.filters.animated = function(a) {
            return m.grep(m.timers, function(b) {
                return a === b.elem
            }).length
        }
    ;
    var cd = a.document.documentElement;
    function dd(a) {
        return m.isWindow(a) ? a : 9 === a.nodeType ? a.defaultView || a.parentWindow : !1
    }
    m.offset = {
        setOffset: function(a, b, c) {
            var d, e, f, g, h, i, j, k = m.css(a, "position"), l = m(a), n = {};
            "static" === k && (a.style.position = "relative"),
                h = l.offset(),
                f = m.css(a, "top"),
                i = m.css(a, "left"),
                j = ("absolute" === k || "fixed" === k) && m.inArray("auto", [f, i]) > -1,
                j ? (d = l.position(),
                    g = d.top,
                    e = d.left) : (g = parseFloat(f) || 0,
                    e = parseFloat(i) || 0),
                m.isFunction(b) && (b = b.call(a, c, h)),
                null != b.top && (n.top = b.top - h.top + g),
                null != b.left && (n.left = b.left - h.left + e),
                    "using"in b ? b.using.call(a, n) : l.css(n)
        }
    },
        m.fn.extend({
            offset: function(a) {
                if (arguments.length)
                    return void 0 === a ? this : this.each(function(b) {
                        m.offset.setOffset(this, a, b)
                    });
                var b, c, d = {
                    top: 0,
                    left: 0
                }, e = this[0], f = e && e.ownerDocument;
                if (f)
                    return b = f.documentElement,
                        m.contains(b, e) ? (typeof e.getBoundingClientRect !== K && (d = e.getBoundingClientRect()),
                            c = dd(f),
                        {
                            top: d.top + (c.pageYOffset || b.scrollTop) - (b.clientTop || 0),
                            left: d.left + (c.pageXOffset || b.scrollLeft) - (b.clientLeft || 0)
                        }) : d
            },
            position: function() {
                if (this[0]) {
                    var a, b, c = {
                        top: 0,
                        left: 0
                    }, d = this[0];
                    return "fixed" === m.css(d, "position") ? b = d.getBoundingClientRect() : (a = this.offsetParent(),
                        b = this.offset(),
                        m.nodeName(a[0], "html") || (c = a.offset()),
                        c.top += m.css(a[0], "borderTopWidth", !0),
                        c.left += m.css(a[0], "borderLeftWidth", !0)),
                    {
                        top: b.top - c.top - m.css(d, "marginTop", !0),
                        left: b.left - c.left - m.css(d, "marginLeft", !0)
                    }
                }
            },
            offsetParent: function() {
                return this.map(function() {
                    var a = this.offsetParent || cd;
                    while (a && !m.nodeName(a, "html") && "static" === m.css(a, "position"))
                        a = a.offsetParent;
                    return a || cd
                })
            }
        }),
        m.each({
            scrollLeft: "pageXOffset",
            scrollTop: "pageYOffset"
        }, function(a, b) {
            var c = /Y/.test(b);
            m.fn[a] = function(d) {
                return V(this, function(a, d, e) {
                    var f = dd(a);
                    return void 0 === e ? f ? b in f ? f[b] : f.document.documentElement[d] : a[d] : void (f ? f.scrollTo(c ? m(f).scrollLeft() : e, c ? e : m(f).scrollTop()) : a[d] = e)
                }, a, d, arguments.length, null)
            }
        }),
        m.each(["top", "left"], function(a, b) {
            m.cssHooks[b] = Lb(k.pixelPosition, function(a, c) {
                return c ? (c = Jb(a, b),
                    Hb.test(c) ? m(a).position()[b] + "px" : c) : void 0
            })
        }),
        m.each({
            Height: "height",
            Width: "width"
        }, function(a, b) {
            m.each({
                padding: "inner" + a,
                content: b,
                "": "outer" + a
            }, function(c, d) {
                m.fn[d] = function(d, e) {
                    var f = arguments.length && (c || "boolean" != typeof d)
                        , g = c || (d === !0 || e === !0 ? "margin" : "border");
                    return V(this, function(b, c, d) {
                        var e;
                        return m.isWindow(b) ? b.document.documentElement["client" + a] : 9 === b.nodeType ? (e = b.documentElement,
                            Math.max(b.body["scroll" + a], e["scroll" + a], b.body["offset" + a], e["offset" + a], e["client" + a])) : void 0 === d ? m.css(b, c, g) : m.style(b, c, d, g)
                    }, b, f ? d : void 0, f, null)
                }
            })
        }),
        m.fn.size = function() {
            return this.length
        }
        ,
        m.fn.andSelf = m.fn.addBack,
        "function" == typeof define && define.amd && define("jquery", [], function() {
        return m
    });
    var ed = a.jQuery
        , fd = a.$;
    return m.noConflict = function(b) {
        return a.$ === m && (a.$ = fd),
            b && a.jQuery === m && (a.jQuery = ed),
            m
    }
        ,
        typeof b === K && (a.jQuery = a.$ = m),
        m
});
if ("undefined" == typeof jQuery)
    throw new Error("Bootstrap's JavaScript requires jQuery");
+function(t) {
    "use strict";
    var e = t.fn.jquery.split(" ")[0].split(".");
    if (e[0] < 2 && e[1] < 9 || 1 == e[0] && 9 == e[1] && e[2] < 1 || e[0] > 3)
        throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")
}(jQuery),
    +function(t) {
        "use strict";
        function e(e) {
            return this.each(function() {
                var i = t(this)
                    , n = i.data("bs.alert");
                n || i.data("bs.alert", n = new o(this)),
                    "string" == typeof e && n[e].call(i)
            })
        }
        var i = '[data-dismiss="alert"]'
            , o = function(e) {
                t(e).on("click", i, this.close)
            };
        o.VERSION = "3.3.7",
            o.TRANSITION_DURATION = 150,
            o.prototype.close = function(e) {
                function i() {
                    r.detach().trigger("closed.bs.alert").remove()
                }
                var n = t(this)
                    , s = n.attr("data-target");
                s || (s = n.attr("href"),
                    s = s && s.replace(/.*(?=#[^\s]*$)/, ""));
                var r = t("#" === s ? [] : s);
                e && e.preventDefault(),
                    r.length || (r = n.closest(".alert")),
                    r.trigger(e = t.Event("close.bs.alert")),
                    e.isDefaultPrevented() || (r.removeClass("in"),
                        t.support.transition && r.hasClass("fade") ? r.one("bsTransitionEnd", i).emulateTransitionEnd(o.TRANSITION_DURATION) : i())
            }
        ;
        var n = t.fn.alert;
        t.fn.alert = e,
            t.fn.alert.Constructor = o,
            t.fn.alert.noConflict = function() {
                return t.fn.alert = n,
                    this
            }
            ,
            t(document).on("click.bs.alert.data-api", i, o.prototype.close)
    }(jQuery),
    +function(t) {
        "use strict";
        function e(e) {
            return this.each(function() {
                var o = t(this)
                    , n = o.data("bs.button")
                    , s = "object" == typeof e && e;
                n || o.data("bs.button", n = new i(this,s)),
                        "toggle" == e ? n.toggle() : e && n.setState(e)
            })
        }
        var i = function(e, o) {
            this.$element = t(e),
                this.options = t.extend({}, i.DEFAULTS, o),
                this.isLoading = !1
        };
        i.VERSION = "3.3.7",
            i.DEFAULTS = {
                loadingText: "loading..."
            },
            i.prototype.setState = function(e) {
                var i = "disabled"
                    , o = this.$element
                    , n = o.is("input") ? "val" : "html"
                    , s = o.data();
                e += "Text",
                    null == s.resetText && o.data("resetText", o[n]()),
                    setTimeout(t.proxy(function() {
                        o[n](null == s[e] ? this.options[e] : s[e]),
                                "loadingText" == e ? (this.isLoading = !0,
                            o.addClass(i).attr(i, i).prop(i, !0)) : this.isLoading && (this.isLoading = !1,
                            o.removeClass(i).removeAttr(i).prop(i, !1))
                    }, this), 0)
            }
            ,
            i.prototype.toggle = function() {
                var t = !0
                    , e = this.$element.closest('[data-toggle="buttons"]');
                if (e.length) {
                    var i = this.$element.find("input");
                    "radio" == i.prop("type") ? (i.prop("checked") && (t = !1),
                        e.find(".active").removeClass("active"),
                        this.$element.addClass("active")) : "checkbox" == i.prop("type") && (i.prop("checked") !== this.$element.hasClass("active") && (t = !1),
                        this.$element.toggleClass("active")),
                        i.prop("checked", this.$element.hasClass("active")),
                        t && i.trigger("change")
                } else
                    this.$element.attr("aria-pressed", !this.$element.hasClass("active")),
                        this.$element.toggleClass("active")
            }
        ;
        var o = t.fn.button;
        t.fn.button = e,
            t.fn.button.Constructor = i,
            t.fn.button.noConflict = function() {
                return t.fn.button = o,
                    this
            }
            ,
            t(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function(i) {
                var o = t(i.target).closest(".btn");
                e.call(o, "toggle"),
                    t(i.target).is('input[type="radio"], input[type="checkbox"]') || (i.preventDefault(),
                    o.is("input,button") ? o.trigger("focus") : o.find("input:visible,button:visible").first().trigger("focus"))
            }).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function(e) {
                t(e.target).closest(".btn").toggleClass("focus", /^focus(in)?$/.test(e.type))
            })
    }(jQuery),
    +function(t) {
        "use strict";
        function e(e) {
            return this.each(function() {
                var o = t(this)
                    , n = o.data("bs.carousel")
                    , s = t.extend({}, i.DEFAULTS, o.data(), "object" == typeof e && e)
                    , r = "string" == typeof e ? e : s.slide;
                n || o.data("bs.carousel", n = new i(this,s)),
                        "number" == typeof e ? n.to(e) : r ? n[r]() : s.interval && n.pause().cycle()
            })
        }
        var i = function(e, i) {
            this.$element = t(e),
                this.$indicators = this.$element.find(".carousel-indicators"),
                this.options = i,
                this.paused = null,
                this.sliding = null,
                this.interval = null,
                this.$active = null,
                this.$items = null,
                this.options.keyboard && this.$element.on("keydown.bs.carousel", t.proxy(this.keydown, this)),
                "hover" == this.options.pause && !("ontouchstart"in document.documentElement) && this.$element.on("mouseenter.bs.carousel", t.proxy(this.pause, this)).on("mouseleave.bs.carousel", t.proxy(this.cycle, this))
        };
        i.VERSION = "3.3.7",
            i.TRANSITION_DURATION = 600,
            i.DEFAULTS = {
                interval: 5e3,
                pause: "hover",
                wrap: !0,
                keyboard: !0
            },
            i.prototype.keydown = function(t) {
                if (!/input|textarea/i.test(t.target.tagName)) {
                    switch (t.which) {
                        case 37:
                            this.prev();
                            break;
                        case 39:
                            this.next();
                            break;
                        default:
                            return
                    }
                    t.preventDefault()
                }
            }
            ,
            i.prototype.cycle = function(e) {
                return e || (this.paused = !1),
                    this.interval && clearInterval(this.interval),
                    this.options.interval && !this.paused && (this.interval = setInterval(t.proxy(this.next, this), this.options.interval)),
                    this
            }
            ,
            i.prototype.getItemIndex = function(t) {
                return this.$items = t.parent().children(".item"),
                    this.$items.index(t || this.$active)
            }
            ,
            i.prototype.getItemForDirection = function(t, e) {
                var i = this.getItemIndex(e)
                    , o = "prev" == t && 0 === i || "next" == t && i == this.$items.length - 1;
                if (o && !this.options.wrap)
                    return e;
                var n = "prev" == t ? -1 : 1
                    , s = (i + n) % this.$items.length;
                return this.$items.eq(s)
            }
            ,
            i.prototype.to = function(t) {
                var e = this
                    , i = this.getItemIndex(this.$active = this.$element.find(".item.active"));
                return t > this.$items.length - 1 || 0 > t ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function() {
                    e.to(t)
                }) : i == t ? this.pause().cycle() : this.slide(t > i ? "next" : "prev", this.$items.eq(t))
            }
            ,
            i.prototype.pause = function(e) {
                return e || (this.paused = !0),
                    this.$element.find(".next, .prev").length && t.support.transition && (this.$element.trigger(t.support.transition.end),
                    this.cycle(!0)),
                    this.interval = clearInterval(this.interval),
                    this
            }
            ,
            i.prototype.next = function() {
                return this.sliding ? void 0 : this.slide("next")
            }
            ,
            i.prototype.prev = function() {
                return this.sliding ? void 0 : this.slide("prev")
            }
            ,
            i.prototype.slide = function(e, o) {
                var n = this.$element.find(".item.active")
                    , s = o || this.getItemForDirection(e, n)
                    , r = this.interval
                    , a = "next" == e ? "left" : "right"
                    , l = this;
                if (s.hasClass("active"))
                    return this.sliding = !1;
                var h = s[0]
                    , p = t.Event("slide.bs.carousel", {
                        relatedTarget: h,
                        direction: a
                    });
                if (this.$element.trigger(p),
                    !p.isDefaultPrevented()) {
                    if (this.sliding = !0,
                        r && this.pause(),
                        this.$indicators.length) {
                        this.$indicators.find(".active").removeClass("active");
                        var c = t(this.$indicators.children()[this.getItemIndex(s)]);
                        c && c.addClass("active")
                    }
                    var d = t.Event("slid.bs.carousel", {
                        relatedTarget: h,
                        direction: a
                    });
                    return t.support.transition && this.$element.hasClass("slide") ? (s.addClass(e),
                        s[0].offsetWidth,
                        n.addClass(a),
                        s.addClass(a),
                        n.one("bsTransitionEnd", function() {
                            s.removeClass([e, a].join(" ")).addClass("active"),
                                n.removeClass(["active", a].join(" ")),
                                l.sliding = !1,
                                setTimeout(function() {
                                    l.$element.trigger(d)
                                }, 0)
                        }).emulateTransitionEnd(i.TRANSITION_DURATION)) : (n.removeClass("active"),
                        s.addClass("active"),
                        this.sliding = !1,
                        this.$element.trigger(d)),
                        r && this.cycle(),
                        this
                }
            }
        ;
        var o = t.fn.carousel;
        t.fn.carousel = e,
            t.fn.carousel.Constructor = i,
            t.fn.carousel.noConflict = function() {
                return t.fn.carousel = o,
                    this
            }
        ;
        var n = function(i) {
            var o, n = t(this), s = t(n.attr("data-target") || (o = n.attr("href")) && o.replace(/.*(?=#[^\s]+$)/, ""));
            if (s.hasClass("carousel")) {
                var r = t.extend({}, s.data(), n.data())
                    , a = n.attr("data-slide-to");
                a && (r.interval = !1),
                    e.call(s, r),
                    a && s.data("bs.carousel").to(a),
                    i.preventDefault()
            }
        };
        t(document).on("click.bs.carousel.data-api", "[data-slide]", n).on("click.bs.carousel.data-api", "[data-slide-to]", n),
            t(window).on("load", function() {
                t('[data-ride="carousel"]').each(function() {
                    var i = t(this);
                    e.call(i, i.data())
                })
            })
    }(jQuery),
    +function(t) {
        "use strict";
        function e(e) {
            var i = e.attr("data-target");
            i || (i = e.attr("href"),
                i = i && /#[A-Za-z]/.test(i) && i.replace(/.*(?=#[^\s]*$)/, ""));
            var o = i && t(i);
            return o && o.length ? o : e.parent()
        }
        function i(i) {
            i && 3 === i.which || (t(n).remove(),
                t(s).each(function() {
                    var o = t(this)
                        , n = e(o)
                        , s = {
                            relatedTarget: this
                        };
                    n.hasClass("open") && (i && "click" == i.type && /input|textarea/i.test(i.target.tagName) && t.contains(n[0], i.target) || (n.trigger(i = t.Event("hide.bs.dropdown", s)),
                        i.isDefaultPrevented() || (o.attr("aria-expanded", "false"),
                        n.removeClass("open").trigger(t.Event("hidden.bs.dropdown", s)))))
                }))
        }
        function o(e) {
            return this.each(function() {
                var i = t(this)
                    , o = i.data("bs.dropdown");
                o || i.data("bs.dropdown", o = new r(this)),
                    "string" == typeof e && o[e].call(i)
            })
        }
        var n = ".dropdown-backdrop"
            , s = '[data-toggle="dropdown"]'
            , r = function(e) {
                t(e).on("click.bs.dropdown", this.toggle)
            };
        r.VERSION = "3.3.7",
            r.prototype.toggle = function(o) {
                var n = t(this);
                if (!n.is(".disabled, :disabled")) {
                    var s = e(n)
                        , r = s.hasClass("open");
                    if (i(),
                        !r) {
                        "ontouchstart"in document.documentElement && !s.closest(".navbar-nav").length && t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click", i);
                        var a = {
                            relatedTarget: this
                        };
                        if (s.trigger(o = t.Event("show.bs.dropdown", a)),
                            o.isDefaultPrevented())
                            return;
                        n.trigger("focus").attr("aria-expanded", "true"),
                            s.toggleClass("open").trigger(t.Event("shown.bs.dropdown", a))
                    }
                    return !1
                }
            }
            ,
            r.prototype.keydown = function(i) {
                if (/(38|40|27|32)/.test(i.which) && !/input|textarea/i.test(i.target.tagName)) {
                    var o = t(this);
                    if (i.preventDefault(),
                        i.stopPropagation(),
                        !o.is(".disabled, :disabled")) {
                        var n = e(o)
                            , r = n.hasClass("open");
                        if (!r && 27 != i.which || r && 27 == i.which)
                            return 27 == i.which && n.find(s).trigger("focus"),
                                o.trigger("click");
                        var a = " li:not(.disabled):visible a"
                            , l = n.find(".dropdown-menu" + a);
                        if (l.length) {
                            var h = l.index(i.target);
                            38 == i.which && h > 0 && h--,
                                40 == i.which && h < l.length - 1 && h++,
                                ~h || (h = 0),
                                l.eq(h).trigger("focus")
                        }
                    }
                }
            }
        ;
        var a = t.fn.dropdown;
        t.fn.dropdown = o,
            t.fn.dropdown.Constructor = r,
            t.fn.dropdown.noConflict = function() {
                return t.fn.dropdown = a,
                    this
            }
            ,
            t(document).on("click.bs.dropdown.data-api", i).on("click.bs.dropdown.data-api", ".dropdown form", function(t) {
                t.stopPropagation()
            }).on("click.bs.dropdown.data-api", s, r.prototype.toggle).on("keydown.bs.dropdown.data-api", s, r.prototype.keydown).on("keydown.bs.dropdown.data-api", ".dropdown-menu", r.prototype.keydown)
    }(jQuery),
    +function(t) {
        "use strict";
        function e(e) {
            return this.each(function() {
                var o = t(this)
                    , n = o.data("bs.tooltip")
                    , s = "object" == typeof e && e;
                !n && /destroy|hide/.test(e) || (n || o.data("bs.tooltip", n = new i(this,s)),
                    "string" == typeof e && n[e]())
            })
        }
        var i = function(t, e) {
            this.type = null,
                this.options = null,
                this.enabled = null,
                this.timeout = null,
                this.hoverState = null,
                this.$element = null,
                this.inState = null,
                this.init("tooltip", t, e)
        };
        i.VERSION = "3.3.7",
            i.TRANSITION_DURATION = 150,
            i.DEFAULTS = {
                animation: !0,
                placement: "top",
                selector: !1,
                template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
                trigger: "hover focus",
                title: "",
                delay: 0,
                html: !1,
                container: !1,
                viewport: {
                    selector: "body",
                    padding: 0
                }
            },
            i.prototype.init = function(e, i, o) {
                if (this.enabled = !0,
                    this.type = e,
                    this.$element = t(i),
                    this.options = this.getOptions(o),
                    this.$viewport = this.options.viewport && t(t.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : this.options.viewport.selector || this.options.viewport),
                    this.inState = {
                        click: !1,
                        hover: !1,
                        focus: !1
                    },
                    this.$element[0]instanceof document.constructor && !this.options.selector)
                    throw new Error("`selector` option must be specified when initializing " + this.type + " on the window.document object!");
                for (var n = this.options.trigger.split(" "), s = n.length; s--; ) {
                    var r = n[s];
                    if ("click" == r)
                        this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
                    else if ("manual" != r) {
                        var a = "hover" == r ? "mouseenter" : "focusin"
                            , l = "hover" == r ? "mouseleave" : "focusout";
                        this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
                            this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
                    }
                }
                this.options.selector ? this._options = t.extend({}, this.options, {
                    trigger: "manual",
                    selector: ""
                }) : this.fixTitle()
            }
            ,
            i.prototype.getDefaults = function() {
                return i.DEFAULTS
            }
            ,
            i.prototype.getOptions = function(e) {
                return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
                    e.delay && "number" == typeof e.delay && (e.delay = {
                    show: e.delay,
                    hide: e.delay
                }),
                    e
            }
            ,
            i.prototype.getDelegateOptions = function() {
                var e = {}
                    , i = this.getDefaults();
                return this._options && t.each(this._options, function(t, o) {
                    i[t] != o && (e[t] = o)
                }),
                    e
            }
            ,
            i.prototype.enter = function(e) {
                var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
                return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
                    t(e.currentTarget).data("bs." + this.type, i)),
                    e instanceof t.Event && (i.inState["focusin" == e.type ? "focus" : "hover"] = !0),
                        i.tip().hasClass("in") || "in" == i.hoverState ? void (i.hoverState = "in") : (clearTimeout(i.timeout),
                    i.hoverState = "in",
                        i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
                    "in" == i.hoverState && i.show()
                }, i.options.delay.show)) : i.show())
            }
            ,
            i.prototype.isInStateTrue = function() {
                for (var t in this.inState)
                    if (this.inState[t])
                        return !0;
                return !1
            }
            ,
            i.prototype.leave = function(e) {
                var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
                return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
                    t(e.currentTarget).data("bs." + this.type, i)),
                    e instanceof t.Event && (i.inState["focusout" == e.type ? "focus" : "hover"] = !1),
                    i.isInStateTrue() ? void 0 : (clearTimeout(i.timeout),
                        i.hoverState = "out",
                            i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
                        "out" == i.hoverState && i.hide()
                    }, i.options.delay.hide)) : i.hide())
            }
            ,
            i.prototype.show = function() {
                var e = t.Event("show.bs." + this.type);
                if (this.hasContent() && this.enabled) {
                    this.$element.trigger(e);
                    var o = t.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]);
                    if (e.isDefaultPrevented() || !o)
                        return;
                    var n = this
                        , s = this.tip()
                        , r = this.getUID(this.type);
                    this.setContent(),
                        s.attr("id", r),
                        this.$element.attr("aria-describedby", r),
                        this.options.animation && s.addClass("fade");
                    var a = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
                        , l = /\s?auto?\s?/i
                        , h = l.test(a);
                    h && (a = a.replace(l, "") || "top"),
                        s.detach().css({
                            top: 0,
                            left: 0,
                            display: "block"
                        }).addClass(a).data("bs." + this.type, this),
                        this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element),
                        this.$element.trigger("inserted.bs." + this.type);
                    var p = this.getPosition()
                        , c = s[0].offsetWidth
                        , d = s[0].offsetHeight;
                    if (h) {
                        var f = a
                            , u = this.getPosition(this.$viewport);
                        a = "bottom" == a && p.bottom + d > u.bottom ? "top" : "top" == a && p.top - d < u.top ? "bottom" : "right" == a && p.right + c > u.width ? "left" : "left" == a && p.left - c < u.left ? "right" : a,
                            s.removeClass(f).addClass(a)
                    }
                    var g = this.getCalculatedOffset(a, p, c, d);
                    this.applyPlacement(g, a);
                    var v = function() {
                        var t = n.hoverState;
                        n.$element.trigger("shown.bs." + n.type),
                            n.hoverState = null,
                            "out" == t && n.leave(n)
                    };
                    t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", v).emulateTransitionEnd(i.TRANSITION_DURATION) : v()
                }
            }
            ,
            i.prototype.applyPlacement = function(e, i) {
                var o = this.tip()
                    , n = o[0].offsetWidth
                    , s = o[0].offsetHeight
                    , r = parseInt(o.css("margin-top"), 10)
                    , a = parseInt(o.css("margin-left"), 10);
                isNaN(r) && (r = 0),
                    isNaN(a) && (a = 0),
                    e.top += r,
                    e.left += a,
                    t.offset.setOffset(o[0], t.extend({
                        using: function(t) {
                            o.css({
                                top: Math.round(t.top),
                                left: Math.round(t.left)
                            })
                        }
                    }, e), 0),
                    o.addClass("in");
                var l = o[0].offsetWidth
                    , h = o[0].offsetHeight;
                "top" == i && h != s && (e.top = e.top + s - h);
                var p = this.getViewportAdjustedDelta(i, e, l, h);
                p.left ? e.left += p.left : e.top += p.top;
                var c = /top|bottom/.test(i)
                    , d = c ? 2 * p.left - n + l : 2 * p.top - s + h
                    , f = c ? "offsetWidth" : "offsetHeight";
                o.offset(e),
                    this.replaceArrow(d, o[0][f], c)
            }
            ,
            i.prototype.replaceArrow = function(t, e, i) {
                this.arrow().css(i ? "left" : "top", 50 * (1 - t / e) + "%").css(i ? "top" : "left", "")
            }
            ,
            i.prototype.setContent = function() {
                var t = this.tip()
                    , e = this.getTitle();
                t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
                    t.removeClass("fade in top bottom left right")
            }
            ,
            i.prototype.hide = function(e) {
                function o() {
                    "in" != n.hoverState && s.detach(),
                        n.$element && n.$element.removeAttr("aria-describedby").trigger("hidden.bs." + n.type),
                        e && e()
                }
                var n = this
                    , s = t(this.$tip)
                    , r = t.Event("hide.bs." + this.type);
                return this.$element.trigger(r),
                    r.isDefaultPrevented() ? void 0 : (s.removeClass("in"),
                            t.support.transition && s.hasClass("fade") ? s.one("bsTransitionEnd", o).emulateTransitionEnd(i.TRANSITION_DURATION) : o(),
                        this.hoverState = null,
                        this)
            }
            ,
            i.prototype.fixTitle = function() {
                var t = this.$element;
                (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
            }
            ,
            i.prototype.hasContent = function() {
                return this.getTitle()
            }
            ,
            i.prototype.getPosition = function(e) {
                e = e || this.$element;
                var i = e[0]
                    , o = "BODY" == i.tagName
                    , n = i.getBoundingClientRect();
                null == n.width && (n = t.extend({}, n, {
                    width: n.right - n.left,
                    height: n.bottom - n.top
                }));
                var s = window.SVGElement && i instanceof window.SVGElement
                    , r = o ? {
                        top: 0,
                        left: 0
                    } : s ? null : e.offset()
                    , a = {
                        scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop()
                    }
                    , l = o ? {
                        width: t(window).width(),
                        height: t(window).height()
                    } : null;
                return t.extend({}, n, a, l, r)
            }
            ,
            i.prototype.getCalculatedOffset = function(t, e, i, o) {
                return "bottom" == t ? {
                    top: e.top + e.height,
                    left: e.left + e.width / 2 - i / 2
                } : "top" == t ? {
                    top: e.top - o,
                    left: e.left + e.width / 2 - i / 2
                } : "left" == t ? {
                    top: e.top + e.height / 2 - o / 2,
                    left: e.left - i
                } : {
                    top: e.top + e.height / 2 - o / 2,
                    left: e.left + e.width
                }
            }
            ,
            i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
                var n = {
                    top: 0,
                    left: 0
                };
                if (!this.$viewport)
                    return n;
                var s = this.options.viewport && this.options.viewport.padding || 0
                    , r = this.getPosition(this.$viewport);
                if (/right|left/.test(t)) {
                    var a = e.top - s - r.scroll
                        , l = e.top + s - r.scroll + o;
                    a < r.top ? n.top = r.top - a : l > r.top + r.height && (n.top = r.top + r.height - l)
                } else {
                    var h = e.left - s
                        , p = e.left + s + i;
                    h < r.left ? n.left = r.left - h : p > r.right && (n.left = r.left + r.width - p)
                }
                return n
            }
            ,
            i.prototype.getTitle = function() {
                var t, e = this.$element, i = this.options;
                return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
            }
            ,
            i.prototype.getUID = function(t) {
                do
                    t += ~~(1e6 * Math.random());
                while (document.getElementById(t));return t
            }
            ,
            i.prototype.tip = function() {
                if (!this.$tip && (this.$tip = t(this.options.template),
                    1 != this.$tip.length))
                    throw new Error(this.type + " `template` option must consist of exactly 1 top-level element!");
                return this.$tip
            }
            ,
            i.prototype.arrow = function() {
                return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
            }
            ,
            i.prototype.enable = function() {
                this.enabled = !0
            }
            ,
            i.prototype.disable = function() {
                this.enabled = !1
            }
            ,
            i.prototype.toggleEnabled = function() {
                this.enabled = !this.enabled
            }
            ,
            i.prototype.toggle = function(e) {
                var i = this;
                e && (i = t(e.currentTarget).data("bs." + this.type),
                    i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
                    t(e.currentTarget).data("bs." + this.type, i))),
                    e ? (i.inState.click = !i.inState.click,
                        i.isInStateTrue() ? i.enter(i) : i.leave(i)) : i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
            }
            ,
            i.prototype.destroy = function() {
                var t = this;
                clearTimeout(this.timeout),
                    this.hide(function() {
                        t.$element.off("." + t.type).removeData("bs." + t.type),
                            t.$tip && t.$tip.detach(),
                            t.$tip = null,
                            t.$arrow = null,
                            t.$viewport = null,
                            t.$element = null
                    })
            }
        ;
        var o = t.fn.tooltip;
        t.fn.tooltip = e,
            t.fn.tooltip.Constructor = i,
            t.fn.tooltip.noConflict = function() {
                return t.fn.tooltip = o,
                    this
            }
    }(jQuery),
    +function(t) {
        "use strict";
        function e(e) {
            return this.each(function() {
                var o = t(this)
                    , n = o.data("bs.popover")
                    , s = "object" == typeof e && e;
                !n && /destroy|hide/.test(e) || (n || o.data("bs.popover", n = new i(this,s)),
                    "string" == typeof e && n[e]())
            })
        }
        var i = function(t, e) {
            this.init("popover", t, e)
        };
        if (!t.fn.tooltip)
            throw new Error("Popover requires tooltip.js");
        i.VERSION = "3.3.7",
            i.DEFAULTS = t.extend({}, t.fn.tooltip.Constructor.DEFAULTS, {
                placement: "right",
                trigger: "click",
                content: "",
                template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
            }),
            i.prototype = t.extend({}, t.fn.tooltip.Constructor.prototype),
            i.prototype.constructor = i,
            i.prototype.getDefaults = function() {
                return i.DEFAULTS
            }
            ,
            i.prototype.setContent = function() {
                var t = this.tip()
                    , e = this.getTitle()
                    , i = this.getContent();
                t.find(".popover-title")[this.options.html ? "html" : "text"](e),
                    t.find(".popover-content").children().detach().end()[this.options.html ? "string" == typeof i ? "html" : "append" : "text"](i),
                    t.removeClass("fade top bottom left right in"),
                    t.find(".popover-title").html() || t.find(".popover-title").hide()
            }
            ,
            i.prototype.hasContent = function() {
                return this.getTitle() || this.getContent()
            }
            ,
            i.prototype.getContent = function() {
                var t = this.$element
                    , e = this.options;
                return t.attr("data-content") || ("function" == typeof e.content ? e.content.call(t[0]) : e.content)
            }
            ,
            i.prototype.arrow = function() {
                return this.$arrow = this.$arrow || this.tip().find(".arrow")
            }
        ;
        var o = t.fn.popover;
        t.fn.popover = e,
            t.fn.popover.Constructor = i,
            t.fn.popover.noConflict = function() {
                return t.fn.popover = o,
                    this
            }
    }(jQuery),
    +function(t) {
        "use strict";
        function e(e) {
            return this.each(function() {
                var o = t(this)
                    , n = o.data("bs.tab");
                n || o.data("bs.tab", n = new i(this)),
                    "string" == typeof e && n[e]()
            })
        }
        var i = function(e) {
            this.element = t(e)
        };
        i.VERSION = "3.3.7",
            i.TRANSITION_DURATION = 150,
            i.prototype.show = function() {
                var e = this.element
                    , i = e.closest("ul:not(.dropdown-menu)")
                    , o = e.data("target");
                if (o || (o = e.attr("href"),
                    o = o && o.replace(/.*(?=#[^\s]*$)/, "")),
                    !e.parent("li").hasClass("active")) {
                    var n = i.find(".active:last a")
                        , s = t.Event("hide.bs.tab", {
                            relatedTarget: e[0]
                        })
                        , r = t.Event("show.bs.tab", {
                            relatedTarget: n[0]
                        });
                    if (n.trigger(s),
                        e.trigger(r),
                        !r.isDefaultPrevented() && !s.isDefaultPrevented()) {
                        var a = t(o);
                        this.activate(e.closest("li"), i),
                            this.activate(a, a.parent(), function() {
                                n.trigger({
                                    type: "hidden.bs.tab",
                                    relatedTarget: e[0]
                                }),
                                    e.trigger({
                                        type: "shown.bs.tab",
                                        relatedTarget: n[0]
                                    })
                            })
                    }
                }
            }
            ,
            i.prototype.activate = function(e, o, n) {
                function s() {
                    r.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !1),
                        e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded", !0),
                        a ? (e[0].offsetWidth,
                            e.addClass("in")) : e.removeClass("fade"),
                        e.parent(".dropdown-menu").length && e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !0),
                        n && n()
                }
                var r = o.find("> .active")
                    , a = n && t.support.transition && (r.length && r.hasClass("fade") || !!o.find("> .fade").length);
                r.length && a ? r.one("bsTransitionEnd", s).emulateTransitionEnd(i.TRANSITION_DURATION) : s(),
                    r.removeClass("in")
            }
        ;
        var o = t.fn.tab;
        t.fn.tab = e,
            t.fn.tab.Constructor = i,
            t.fn.tab.noConflict = function() {
                return t.fn.tab = o,
                    this
            }
        ;
        var n = function(i) {
            i.preventDefault(),
                e.call(t(this), "show")
        };
        t(document).on("click.bs.tab.data-api", '[data-toggle="tab"]', n).on("click.bs.tab.data-api", '[data-toggle="pill"]', n)
    }(jQuery),
    +function(t) {
        "use strict";
        function e(e) {
            return this.each(function() {
                var o = t(this)
                    , n = o.data("bs.affix")
                    , s = "object" == typeof e && e;
                n || o.data("bs.affix", n = new i(this,s)),
                    "string" == typeof e && n[e]()
            })
        }
        var i = function(e, o) {
            this.options = t.extend({}, i.DEFAULTS, o),
                this.$target = t(this.options.target).on("scroll.bs.affix.data-api", t.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", t.proxy(this.checkPositionWithEventLoop, this)),
                this.$element = t(e),
                this.affixed = null,
                this.unpin = null,
                this.pinnedOffset = null,
                this.checkPosition()
        };
        i.VERSION = "3.3.7",
            i.RESET = "affix affix-top affix-bottom",
            i.DEFAULTS = {
                offset: 0,
                target: window
            },
            i.prototype.getState = function(t, e, i, o) {
                var n = this.$target.scrollTop()
                    , s = this.$element.offset()
                    , r = this.$target.height();
                if (null != i && "top" == this.affixed)
                    return i > n ? "top" : !1;
                if ("bottom" == this.affixed)
                    return null != i ? n + this.unpin <= s.top ? !1 : "bottom" : t - o >= n + r ? !1 : "bottom";
                var a = null == this.affixed
                    , l = a ? n : s.top
                    , h = a ? r : e;
                return null != i && i >= n ? "top" : null != o && l + h >= t - o ? "bottom" : !1
            }
            ,
            i.prototype.getPinnedOffset = function() {
                if (this.pinnedOffset)
                    return this.pinnedOffset;
                this.$element.removeClass(i.RESET).addClass("affix");
                var t = this.$target.scrollTop()
                    , e = this.$element.offset();
                return this.pinnedOffset = e.top - t
            }
            ,
            i.prototype.checkPositionWithEventLoop = function() {
                setTimeout(t.proxy(this.checkPosition, this), 1)
            }
            ,
            i.prototype.checkPosition = function() {
                if (this.$element.is(":visible")) {
                    var e = this.$element.height()
                        , o = this.options.offset
                        , n = o.top
                        , s = o.bottom
                        , r = Math.max(t(document).height(), t(document.body).height());
                    "object" != typeof o && (s = n = o),
                        "function" == typeof n && (n = o.top(this.$element)),
                        "function" == typeof s && (s = o.bottom(this.$element));
                    var a = this.getState(r, e, n, s);
                    if (this.affixed != a) {
                        null != this.unpin && this.$element.css("top", "");
                        var l = "affix" + (a ? "-" + a : "")
                            , h = t.Event(l + ".bs.affix");
                        if (this.$element.trigger(h),
                            h.isDefaultPrevented())
                            return;
                        this.affixed = a,
                            this.unpin = "bottom" == a ? this.getPinnedOffset() : null,
                            this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix", "affixed") + ".bs.affix")
                    }
                    "bottom" == a && this.$element.offset({
                        top: r - e - s
                    })
                }
            }
        ;
        var o = t.fn.affix;
        t.fn.affix = e,
            t.fn.affix.Constructor = i,
            t.fn.affix.noConflict = function() {
                return t.fn.affix = o,
                    this
            }
            ,
            t(window).on("load", function() {
                t('[data-spy="affix"]').each(function() {
                    var i = t(this)
                        , o = i.data();
                    o.offset = o.offset || {},
                        null != o.offsetBottom && (o.offset.bottom = o.offsetBottom),
                        null != o.offsetTop && (o.offset.top = o.offsetTop),
                        e.call(i, o)
                })
            })
    }(jQuery),
    +function(t) {
        "use strict";
        function e(e) {
            var i, o = e.attr("data-target") || (i = e.attr("href")) && i.replace(/.*(?=#[^\s]+$)/, "");
            return t(o)
        }
        function i(e) {
            return this.each(function() {
                var i = t(this)
                    , n = i.data("bs.collapse")
                    , s = t.extend({}, o.DEFAULTS, i.data(), "object" == typeof e && e);
                !n && s.toggle && /show|hide/.test(e) && (s.toggle = !1),
                    n || i.data("bs.collapse", n = new o(this,s)),
                    "string" == typeof e && n[e]()
            })
        }
        var o = function(e, i) {
            this.$element = t(e),
                this.options = t.extend({}, o.DEFAULTS, i),
                this.$trigger = t('[data-toggle="collapse"][href="#' + e.id + '"],[data-toggle="collapse"][data-target="#' + e.id + '"]'),
                this.transitioning = null,
                this.options.parent ? this.$parent = this.getParent() : this.addAriaAndCollapsedClass(this.$element, this.$trigger),
                this.options.toggle && this.toggle()
        };
        o.VERSION = "3.3.7",
            o.TRANSITION_DURATION = 350,
            o.DEFAULTS = {
                toggle: !0
            },
            o.prototype.dimension = function() {
                var t = this.$element.hasClass("width");
                return t ? "width" : "height"
            }
            ,
            o.prototype.show = function() {
                if (!this.transitioning && !this.$element.hasClass("in")) {
                    var e, n = this.$parent && this.$parent.children(".panel").children(".in, .collapsing");
                    if (!(n && n.length && (e = n.data("bs.collapse"),
                        e && e.transitioning))) {
                        var s = t.Event("show.bs.collapse");
                        if (this.$element.trigger(s),
                            !s.isDefaultPrevented()) {
                            n && n.length && (i.call(n, "hide"),
                                e || n.data("bs.collapse", null));
                            var r = this.dimension();
                            this.$element.removeClass("collapse").addClass("collapsing")[r](0).attr("aria-expanded", !0),
                                this.$trigger.removeClass("collapsed").attr("aria-expanded", !0),
                                this.transitioning = 1;
                            var a = function() {
                                this.$element.removeClass("collapsing").addClass("collapse in")[r](""),
                                    this.transitioning = 0,
                                    this.$element.trigger("shown.bs.collapse")
                            };
                            if (!t.support.transition)
                                return a.call(this);
                            var l = t.camelCase(["scroll", r].join("-"));
                            this.$element.one("bsTransitionEnd", t.proxy(a, this)).emulateTransitionEnd(o.TRANSITION_DURATION)[r](this.$element[0][l])
                        }
                    }
                }
            }
            ,
            o.prototype.hide = function() {
                if (!this.transitioning && this.$element.hasClass("in")) {
                    var e = t.Event("hide.bs.collapse");
                    if (this.$element.trigger(e),
                        !e.isDefaultPrevented()) {
                        var i = this.dimension();
                        this.$element[i](this.$element[i]())[0].offsetHeight,
                            this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1),
                            this.$trigger.addClass("collapsed").attr("aria-expanded", !1),
                            this.transitioning = 1;
                        var n = function() {
                            this.transitioning = 0,
                                this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")
                        };
                        return t.support.transition ? void this.$element[i](0).one("bsTransitionEnd", t.proxy(n, this)).emulateTransitionEnd(o.TRANSITION_DURATION) : n.call(this)
                    }
                }
            }
            ,
            o.prototype.toggle = function() {
                this[this.$element.hasClass("in") ? "hide" : "show"]()
            }
            ,
            o.prototype.getParent = function() {
                return t(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each(t.proxy(function(i, o) {
                    var n = t(o);
                    this.addAriaAndCollapsedClass(e(n), n)
                }, this)).end()
            }
            ,
            o.prototype.addAriaAndCollapsedClass = function(t, e) {
                var i = t.hasClass("in");
                t.attr("aria-expanded", i),
                    e.toggleClass("collapsed", !i).attr("aria-expanded", i)
            }
        ;
        var n = t.fn.collapse;
        t.fn.collapse = i,
            t.fn.collapse.Constructor = o,
            t.fn.collapse.noConflict = function() {
                return t.fn.collapse = n,
                    this
            }
            ,
            t(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function(o) {
                var n = t(this);
                n.attr("data-target") || o.preventDefault();
                var s = e(n)
                    , r = s.data("bs.collapse")
                    , a = r ? "toggle" : n.data();
                i.call(s, a)
            })
    }(jQuery),
    +function(t) {
        "use strict";
        function e(i, o) {
            this.$body = t(document.body),
                this.$scrollElement = t(t(i).is(document.body) ? window : i),
                this.options = t.extend({}, e.DEFAULTS, o),
                this.selector = (this.options.target || "") + " .nav li > a",
                this.offsets = [],
                this.targets = [],
                this.activeTarget = null,
                this.scrollHeight = 0,
                this.$scrollElement.on("scroll.bs.scrollspy", t.proxy(this.process, this)),
                this.refresh(),
                this.process()
        }
        function i(i) {
            return this.each(function() {
                var o = t(this)
                    , n = o.data("bs.scrollspy")
                    , s = "object" == typeof i && i;
                n || o.data("bs.scrollspy", n = new e(this,s)),
                    "string" == typeof i && n[i]()
            })
        }
        e.VERSION = "3.3.7",
            e.DEFAULTS = {
                offset: 10
            },
            e.prototype.getScrollHeight = function() {
                return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
            }
            ,
            e.prototype.refresh = function() {
                var e = this
                    , i = "offset"
                    , o = 0;
                this.offsets = [],
                    this.targets = [],
                    this.scrollHeight = this.getScrollHeight(),
                    t.isWindow(this.$scrollElement[0]) || (i = "position",
                    o = this.$scrollElement.scrollTop()),
                    this.$body.find(this.selector).map(function() {
                        var e = t(this)
                            , n = e.data("target") || e.attr("href")
                            , s = /^#./.test(n) && t(n);
                        return s && s.length && s.is(":visible") && [[s[i]().top + o, n]] || null
                    }).sort(function(t, e) {
                        return t[0] - e[0]
                    }).each(function() {
                        e.offsets.push(this[0]),
                            e.targets.push(this[1])
                    })
            }
            ,
            e.prototype.process = function() {
                var t, e = this.$scrollElement.scrollTop() + this.options.offset, i = this.getScrollHeight(), o = this.options.offset + i - this.$scrollElement.height(), n = this.offsets, s = this.targets, r = this.activeTarget;
                if (this.scrollHeight != i && this.refresh(),
                    e >= o)
                    return r != (t = s[s.length - 1]) && this.activate(t);
                if (r && e < n[0])
                    return this.activeTarget = null,
                        this.clear();
                for (t = n.length; t--; )
                    r != s[t] && e >= n[t] && (void 0 === n[t + 1] || e < n[t + 1]) && this.activate(s[t])
            }
            ,
            e.prototype.activate = function(e) {
                this.activeTarget = e,
                    this.clear();
                var i = this.selector + '[data-target="' + e + '"],' + this.selector + '[href="' + e + '"]'
                    , o = t(i).parents("li").addClass("active");
                o.parent(".dropdown-menu").length && (o = o.closest("li.dropdown").addClass("active")),
                    o.trigger("activate.bs.scrollspy")
            }
            ,
            e.prototype.clear = function() {
                t(this.selector).parentsUntil(this.options.target, ".active").removeClass("active")
            }
        ;
        var o = t.fn.scrollspy;
        t.fn.scrollspy = i,
            t.fn.scrollspy.Constructor = e,
            t.fn.scrollspy.noConflict = function() {
                return t.fn.scrollspy = o,
                    this
            }
            ,
            t(window).on("load.bs.scrollspy.data-api", function() {
                t('[data-spy="scroll"]').each(function() {
                    var e = t(this);
                    i.call(e, e.data())
                })
            })
    }(jQuery),
    +function(t) {
        "use strict";
        function e() {
            var t = document.createElement("bootstrap")
                , e = {
                    WebkitTransition: "webkitTransitionEnd",
                    MozTransition: "transitionend",
                    OTransition: "oTransitionEnd otransitionend",
                    transition: "transitionend"
                };
            for (var i in e)
                if (void 0 !== t.style[i])
                    return {
                        end: e[i]
                    };
            return !1
        }
        t.fn.emulateTransitionEnd = function(e) {
            var i = !1
                , o = this;
            t(this).one("bsTransitionEnd", function() {
                i = !0
            });
            var n = function() {
                i || t(o).trigger(t.support.transition.end)
            };
            return setTimeout(n, e),
                this
        }
            ,
            t(function() {
                t.support.transition = e(),
                    t.support.transition && (t.event.special.bsTransitionEnd = {
                    bindType: t.support.transition.end,
                    delegateType: t.support.transition.end,
                    handle: function(e) {
                        return t(e.target).is(this) ? e.handleObj.handler.apply(this, arguments) : void 0
                    }
                })
            })
    }(jQuery);
(function() {
    var e, t = window.Messenger;
    e = window.Messenger = function() {
        return e._call.apply(this, arguments)
    }
        ,
        window.Messenger.noConflict = function() {
            return window.Messenger = t,
                e
        }
})(),
    window.Messenger._ = function() {
        if (window._)
            return window._;
        var e = Array.prototype
            , t = Object.prototype
            , n = Function.prototype
            , s = (e.push,
                e.slice)
            , r = (e.concat,
                t.toString);
        t.hasOwnProperty;
        var o = e.forEach
            , i = (e.map,
                e.reduce,
                e.reduceRight,
                e.filter)
            , a = (e.every,
                e.some,
                e.indexOf,
                e.lastIndexOf,
                Array.isArray,
                Object.keys)
            , l = n.bind
            , u = {}
            , c = {}
            , h = u.each = u.forEach = function(e, t, n) {
                if (null != e)
                    if (o && e.forEach === o)
                        e.forEach(t, n);
                    else if (e.length === +e.length) {
                        for (var s = 0, r = e.length; r > s; s++)
                            if (t.call(n, e[s], s, e) === c)
                                return
                    } else
                        for (var i in e)
                            if (u.has(e, i) && t.call(n, e[i], i, e) === c)
                                return
            }
            ;
        u.result = function(e, t) {
            if (null == e)
                return null;
            var n = e[t];
            return u.isFunction(n) ? n.call(e) : n
        }
            ,
            u.once = function(e) {
                var t, n = !1;
                return function() {
                    return n ? t : (n = !0,
                        t = e.apply(this, arguments),
                        e = null,
                        t)
                }
            }
        ;
        var p = 0;
        return u.uniqueId = function(e) {
            var t = ++p + "";
            return e ? e + t : t
        }
            ,
            u.filter = u.select = function(e, t, n) {
                var s = [];
                return null == e ? s : i && e.filter === i ? e.filter(t, n) : (h(e, function(e, r, o) {
                    t.call(n, e, r, o) && (s[s.length] = e)
                }),
                    s)
            }
            ,
            h(["Arguments", "Function", "String", "Number", "Date", "RegExp"], function(e) {
                u["is" + e] = function(t) {
                    return r.call(t) == "[object " + e + "]"
                }
            }),
            u.defaults = function(e) {
                return h(s.call(arguments, 1), function(t) {
                    if (t)
                        for (var n in t)
                            null == e[n] && (e[n] = t[n])
                }),
                    e
            }
            ,
            u.extend = function(e) {
                return h(s.call(arguments, 1), function(t) {
                    if (t)
                        for (var n in t)
                            e[n] = t[n]
                }),
                    e
            }
            ,
            u.keys = a || function(e) {
                if (e !== Object(e))
                    throw new TypeError("Invalid object");
                var t = [];
                for (var n in e)
                    u.has(e, n) && (t[t.length] = n);
                return t
            }
            ,
            u.bind = function(e, t) {
                if (e.bind === l && l)
                    return l.apply(e, s.call(arguments, 1));
                var n = s.call(arguments, 2);
                return function() {
                    return e.apply(t, n.concat(s.call(arguments)))
                }
            }
            ,
            u.isObject = function(e) {
                return e === Object(e)
            }
            ,
            u
    }(),
    window.Messenger.Events = function() {
        if (window.Backbone && Backbone.Events)
            return Backbone.Events;
        var e = function() {
            var e = /\s+/
                , t = function(t, n, s, r) {
                    if (!s)
                        return !0;
                    if ("object" == typeof s)
                        for (var o in s)
                            t[n].apply(t, [o, s[o]].concat(r));
                    else {
                        if (!e.test(s))
                            return !0;
                        for (var i = s.split(e), a = 0, l = i.length; l > a; a++)
                            t[n].apply(t, [i[a]].concat(r))
                    }
                }
                , n = function(e, t) {
                    var n, s = -1, r = e.length;
                    switch (t.length) {
                        case 0:
                            for (; r > ++s; )
                                (n = e[s]).callback.call(n.ctx);
                            return;
                        case 1:
                            for (; r > ++s; )
                                (n = e[s]).callback.call(n.ctx, t[0]);
                            return;
                        case 2:
                            for (; r > ++s; )
                                (n = e[s]).callback.call(n.ctx, t[0], t[1]);
                            return;
                        case 3:
                            for (; r > ++s; )
                                (n = e[s]).callback.call(n.ctx, t[0], t[1], t[2]);
                            return;
                        default:
                            for (; r > ++s; )
                                (n = e[s]).callback.apply(n.ctx, t)
                    }
                }
                , s = {
                    on: function(e, n, s) {
                        if (!t(this, "on", e, [n, s]) || !n)
                            return this;
                        this._events || (this._events = {});
                        var r = this._events[e] || (this._events[e] = []);
                        return r.push({
                            callback: n,
                            context: s,
                            ctx: s || this
                        }),
                            this
                    },
                    once: function(e, n, s) {
                        if (!t(this, "once", e, [n, s]) || !n)
                            return this;
                        var r = this
                            , o = _.once(function() {
                                r.off(e, o),
                                    n.apply(this, arguments)
                            });
                        return o._callback = n,
                            this.on(e, o, s),
                            this
                    },
                    off: function(e, n, s) {
                        var r, o, i, a, l, u, c, h;
                        if (!this._events || !t(this, "off", e, [n, s]))
                            return this;
                        if (!e && !n && !s)
                            return this._events = {},
                                this;
                        for (a = e ? [e] : _.keys(this._events),
                                 l = 0,
                                 u = a.length; u > l; l++)
                            if (e = a[l],
                                r = this._events[e]) {
                                if (i = [],
                                    n || s)
                                    for (c = 0,
                                             h = r.length; h > c; c++)
                                        o = r[c],
                                            (n && n !== o.callback && n !== o.callback._callback || s && s !== o.context) && i.push(o);
                                this._events[e] = i
                            }
                        return this
                    },
                    trigger: function(e) {
                        if (!this._events)
                            return this;
                        var s = Array.prototype.slice.call(arguments, 1);
                        if (!t(this, "trigger", e, s))
                            return this;
                        var r = this._events[e]
                            , o = this._events.all;
                        return r && n(r, s),
                            o && n(o, arguments),
                            this
                    },
                    listenTo: function(e, t, n) {
                        var s = this._listeners || (this._listeners = {})
                            , r = e._listenerId || (e._listenerId = _.uniqueId("l"));
                        return s[r] = e,
                            e.on(t, "object" == typeof t ? this : n, this),
                            this
                    },
                    stopListening: function(e, t, n) {
                        var s = this._listeners;
                        if (s) {
                            if (e)
                                e.off(t, "object" == typeof t ? this : n, this),
                                    t || n || delete s[e._listenerId];
                            else {
                                "object" == typeof t && (n = this);
                                for (var r in s)
                                    s[r].off(t, n, this);
                                this._listeners = {}
                            }
                            return this
                        }
                    }
                };
            return s.bind = s.on,
                s.unbind = s.off,
                s
        };
        return e()
    }(),
    function() {
        var e, t, n, s, r, o, i, a, l, u, c, h = {}.hasOwnProperty, p = function(e, t) {
                function n() {
                    this.constructor = e
                }
                for (var s in t)
                    h.call(t, s) && (e[s] = t[s]);
                return n.prototype = t.prototype,
                    e.prototype = new n,
                    e.__super__ = t.prototype,
                    e
            }, d = [].slice, f = [].indexOf || function(e) {
                for (var t = 0, n = this.length; n > t; t++)
                    if (t in this && this[t] === e)
                        return t;
                return -1
            }
            ;
        e = jQuery,
            o = null != (l = window._) ? l : window.Messenger._,
            s = null != (u = "undefined" != typeof Backbone && null !== Backbone ? Backbone.Events : void 0) ? u : window.Messenger.Events,
            n = function() {
                function t(t) {
                    e.extend(this, s),
                        o.isObject(t) && (t.el && this.setElement(t.el),
                        this.model = t.model),
                        this.initialize.apply(this, arguments)
                }
                return t.prototype.setElement = function(t) {
                    return this.$el = e(t),
                        this.el = this.$el[0]
                }
                    ,
                    t.prototype.delegateEvents = function(e) {
                        var t, n, s, r, i, a, l;
                        if (e || (e = o.result(this, "events"))) {
                            this.undelegateEvents(),
                                t = /^(\S+)\s*(.*)$/,
                                l = [];
                            for (s in e) {
                                if (i = e[s],
                                    o.isFunction(i) || (i = this[e[s]]),
                                    !i)
                                    throw Error('Method "' + e[s] + '" does not exist');
                                r = s.match(t),
                                    n = r[1],
                                    a = r[2],
                                    i = o.bind(i, this),
                                    n += ".delegateEvents" + this.cid,
                                        "" === a ? l.push(this.jqon(n, i)) : l.push(this.jqon(n, a, i))
                            }
                            return l
                        }
                    }
                    ,
                    t.prototype.jqon = function(e, t, n) {
                        var s;
                        return null != this.$el.on ? (s = this.$el).on.apply(s, arguments) : (null == n && (n = t,
                            t = void 0),
                                null != t ? this.$el.delegate(t, e, n) : this.$el.bind(e, n))
                    }
                    ,
                    t.prototype.jqoff = function(e) {
                        var t;
                        return null != this.$el.off ? (t = this.$el).off.apply(t, arguments) : (this.$el.undelegate(),
                            this.$el.unbind(e))
                    }
                    ,
                    t.prototype.undelegateEvents = function() {
                        return this.jqoff(".delegateEvents" + this.cid)
                    }
                    ,
                    t.prototype.remove = function() {
                        return this.undelegateEvents(),
                            this.$el.remove()
                    }
                    ,
                    t
            }(),
            i = function(t) {
                function n() {
                    return n.__super__.constructor.apply(this, arguments)
                }
                return p(n, t),
                    n.prototype.defaults = {
                        hideAfter: 10,
                        scroll: !0,
                        closeButtonText: "&times;",
                        escapeText: !1
                    },
                    n.prototype.initialize = function(t) {
                        return null == t && (t = {}),
                            this.shown = !1,
                            this.rendered = !1,
                            this.messenger = t.messenger,
                            this.options = e.extend({}, this.options, t, this.defaults)
                    }
                    ,
                    n.prototype.show = function() {
                        var e;
                        return this.rendered || this.render(),
                            this.$message.removeClass("messenger-hidden"),
                            e = this.shown,
                            this.shown = !0,
                            e ? void 0 : this.trigger("show")
                    }
                    ,
                    n.prototype.hide = function() {
                        var e;
                        if (this.rendered)
                            return this.$message.addClass("messenger-hidden"),
                                e = this.shown,
                                this.shown = !1,
                                e ? this.trigger("hide") : void 0
                    }
                    ,
                    n.prototype.cancel = function() {
                        return this.hide()
                    }
                    ,
                    n.prototype.update = function(t) {
                        var n, s = this;
                        return o.isString(t) && (t = {
                            message: t
                        }),
                            e.extend(this.options, t),
                            this.lastUpdate = new Date,
                            this.rendered = !1,
                            this.events = null != (n = this.options.events) ? n : {},
                            this.render(),
                            this.actionsToEvents(),
                            this.delegateEvents(),
                            this.checkClickable(),
                            this.options.hideAfter ? (this.$message.addClass("messenger-will-hide-after"),
                                null != this._hideTimeout && clearTimeout(this._hideTimeout),
                                this._hideTimeout = setTimeout(function() {
                                    return s.hide()
                                }, 1e3 * this.options.hideAfter)) : this.$message.removeClass("messenger-will-hide-after"),
                            this.options.hideOnNavigate ? (this.$message.addClass("messenger-will-hide-on-navigate"),
                                null != ("undefined" != typeof Backbone && null !== Backbone ? Backbone.history : void 0) && Backbone.history.on("route", function() {
                                return s.hide()
                            })) : this.$message.removeClass("messenger-will-hide-on-navigate"),
                            this.trigger("update", this)
                    }
                    ,
                    n.prototype.scrollTo = function() {
                        return this.options.scroll ? e.scrollTo(this.$el, {
                            duration: 400,
                            offset: {
                                left: 0,
                                top: -20
                            }
                        }) : void 0
                    }
                    ,
                    n.prototype.timeSinceUpdate = function() {
                        return this.lastUpdate ? new Date - this.lastUpdate : null
                    }
                    ,
                    n.prototype.actionsToEvents = function() {
                        var e, t, n, s, r = this;
                        n = this.options.actions,
                            s = [];
                        for (t in n)
                            e = n[t],
                                s.push(this.events['click [data-action="' + t + '"] a'] = function(e) {
                                    return function(n) {
                                        return n.preventDefault(),
                                            n.stopPropagation(),
                                            r.trigger("action:" + t, e, n),
                                            e.action.call(r, n, r)
                                    }
                                }(e));
                        return s
                    }
                    ,
                    n.prototype.checkClickable = function() {
                        var e, t, n, s;
                        n = this.events,
                            s = [];
                        for (t in n)
                            e = n[t],
                                    "click" === t ? s.push(this.$message.addClass("messenger-clickable")) : s.push(void 0);
                        return s
                    }
                    ,
                    n.prototype.undelegateEvents = function() {
                        var e;
                        return n.__super__.undelegateEvents.apply(this, arguments),
                                null != (e = this.$message) ? e.removeClass("messenger-clickable") : void 0
                    }
                    ,
                    n.prototype.parseActions = function() {
                        var t, n, s, r, o, i;
                        n = [],
                            o = this.options.actions;
                        for (r in o)
                            t = o[r],
                                s = e.extend({}, t),
                                s.name = r,
                                null == (i = s.label) && (s.label = r),
                                n.push(s);
                        return n
                    }
                    ,
                    n.prototype.template = function(t) {
                        var n, s, r, o, i, a, l, u, c, h, p = this;
                        for (i = e("<div class='messenger-message message alert " + t.type + " message-" + t.type + " alert-" + t.type + "'>"),
                                 t.showCloseButton && (r = e('<button type="button" class="messenger-close" data-dismiss="alert">'),
                                 r.html(t.closeButtonText),
                                 r.click(function() {
                                     return p.cancel(),
                                         !0
                                 }),
                                 i.append(r)),
                                 a = t.escapeText ? e('<div class="messenger-message-inner"></div>').text(t.message) : e('<div class="messenger-message-inner">' + t.message + "</div>"),
                                 i.append(a),
                                 t.actions.length && (s = e('<div class="messenger-actions">')),
                                 h = t.actions,
                                 u = 0,
                                 c = h.length; c > u; u++)
                            l = h[u],
                                n = e("<span>"),
                                n.attr("data-action", "" + l.name),
                                o = e("<a>"),
                                o.html(l.label),
                                n.append(e('<span class="messenger-phrase">')),
                                n.append(o),
                                s.append(n);
                        return i.append(s),
                            i
                    }
                    ,
                    n.prototype.render = function() {
                        var t;
                        if (!this.rendered)
                            return this._hasSlot || (this.setElement(this.messenger._reserveMessageSlot(this)),
                                this._hasSlot = !0),
                                t = e.extend({}, this.options, {
                                    actions: this.parseActions()
                                }),
                                this.$message = e(this.template(t)),
                                this.$el.html(this.$message),
                                this.shown = !0,
                                this.rendered = !0,
                                this.trigger("render")
                    }
                    ,
                    n
            }(n),
            r = function(e) {
                function t() {
                    return t.__super__.constructor.apply(this, arguments)
                }
                return p(t, e),
                    t.prototype.initialize = function() {
                        return t.__super__.initialize.apply(this, arguments),
                            this._timers = {}
                    }
                    ,
                    t.prototype.cancel = function() {
                        return this.clearTimers(),
                            this.hide(),
                                null != this._actionInstance && null != this._actionInstance.abort ? this._actionInstance.abort() : void 0
                    }
                    ,
                    t.prototype.clearTimers = function() {
                        var e, t, n, s;
                        n = this._timers;
                        for (e in n)
                            t = n[e],
                                clearTimeout(t);
                        return this._timers = {},
                                null != (s = this.$message) ? s.removeClass("messenger-retry-soon messenger-retry-later") : void 0
                    }
                    ,
                    t.prototype.render = function() {
                        var e, n, s, r;
                        t.__super__.render.apply(this, arguments),
                            this.clearTimers(),
                            s = this.options.actions,
                            r = [];
                        for (n in s)
                            e = s[n],
                                e.auto ? r.push(this.startCountdown(n, e)) : r.push(void 0);
                        return r
                    }
                    ,
                    t.prototype.renderPhrase = function(e, t) {
                        var n;
                        return n = e.phrase.replace("TIME", this.formatTime(t))
                    }
                    ,
                    t.prototype.formatTime = function(e) {
                        var t;
                        return t = function(e, t) {
                            return e = Math.floor(e),
                                1 !== e && (t += "s"),
                                "in " + e + " " + t
                        }
                            ,
                                0 === Math.floor(e) ? "now..." : 60 > e ? t(e, "second") : (e /= 60,
                                60 > e ? t(e, "minute") : (e /= 60,
                            t(e, "hour")))
                    }
                    ,
                    t.prototype.startCountdown = function(e, t) {
                        var n, s, r, o, i = this;
                        if (null == this._timers[e])
                            return n = this.$message.find("[data-action='" + e + "'] .messenger-phrase"),
                                s = null != (o = t.delay) ? o : 3,
                                    10 >= s ? (this.$message.removeClass("messenger-retry-later"),
                                this.$message.addClass("messenger-retry-soon")) : (this.$message.removeClass("messenger-retry-soon"),
                                this.$message.addClass("messenger-retry-later")),
                                r = function() {
                                    var o;
                                    return n.text(i.renderPhrase(t, s)),
                                            s > 0 ? (o = Math.min(s, 1),
                                        s -= o,
                                        i._timers[e] = setTimeout(r, 1e3 * o)) : (i.$message.removeClass("messenger-retry-soon messenger-retry-later"),
                                        delete i._timers[e],
                                        t.action())
                                }
                                ,
                                r()
                    }
                    ,
                    t
            }(i),
            a = function(t) {
                function n() {
                    return n.__super__.constructor.apply(this, arguments)
                }
                return p(n, t),
                    n.prototype.tagName = "ul",
                    n.prototype.className = "messenger",
                    n.prototype.messageDefaults = {
                        type: "info"
                    },
                    n.prototype.initialize = function(t) {
                        return this.options = null != t ? t : {},
                            this.history = [],
                            this.messageDefaults = e.extend({}, this.messageDefaults, this.options.messageDefaults)
                    }
                    ,
                    n.prototype.render = function() {
                        return this.updateMessageSlotClasses()
                    }
                    ,
                    n.prototype.findById = function(e) {
                        return o.filter(this.history, function(t) {
                            return t.msg.options.id === e
                        })
                    }
                    ,
                    n.prototype._reserveMessageSlot = function(t) {
                        var n, s, r = this;
                        for (n = e("<li>"),
                                 n.addClass("messenger-message-slot"),
                                 this.$el.prepend(n),
                                 this.history.push({
                                     msg: t,
                                     $slot: n
                                 }),
                                 this._enforceIdConstraint(t),
                                 t.on("update", function() {
                                     return r._enforceIdConstraint(t)
                                 }); this.options.maxMessages && this.history.length > this.options.maxMessages; )
                            s = this.history.shift(),
                                s.msg.remove(),
                                s.$slot.remove();
                        return n
                    }
                    ,
                    n.prototype._enforceIdConstraint = function(e) {
                        var t, n, s, r, o;
                        if (null != e.options.id)
                            for (o = this.history,
                                     n = 0,
                                     s = o.length; s > n; n++)
                                if (t = o[n],
                                    r = t.msg,
                                    null != r.options.id && r.options.id === e.options.id && e !== r) {
                                    if (e.options.singleton)
                                        return e.hide(),
                                            void 0;
                                    r.hide()
                                }
                    }
                    ,
                    n.prototype.newMessage = function(e) {
                        var t, n, s, o, a = this;
                        return null == e && (e = {}),
                            e.messenger = this,
                            i = null != (n = null != (s = Messenger.themes[null != (o = e.theme) ? o : this.options.theme]) ? s.Message : void 0) ? n : r,
                            t = new i(e),
                            t.on("show", function() {
                                return e.scrollTo && "fixed" !== a.$el.css("position") ? t.scrollTo() : void 0
                            }),
                            t.on("hide show render", this.updateMessageSlotClasses, this),
                            t
                    }
                    ,
                    n.prototype.updateMessageSlotClasses = function() {
                        var e, t, n, s, r, o, i;
                        for (s = !0,
                                 t = null,
                                 e = !1,
                                 i = this.history,
                                 r = 0,
                                 o = i.length; o > r; r++)
                            n = i[r],
                                n.$slot.removeClass("messenger-first messenger-last messenger-shown"),
                                n.msg.shown && n.msg.rendered && (n.$slot.addClass("messenger-shown"),
                                e = !0,
                                t = n,
                                s && (s = !1,
                                n.$slot.addClass("messenger-first")));
                        return null != t && t.$slot.addClass("messenger-last"),
                            this.$el["" + (e ? "remove" : "add") + "Class"]("messenger-empty")
                    }
                    ,
                    n.prototype.hideAll = function() {
                        var e, t, n, s, r;
                        for (s = this.history,
                                 r = [],
                                 t = 0,
                                 n = s.length; n > t; t++)
                            e = s[t],
                                r.push(e.msg.hide());
                        return r
                    }
                    ,
                    n.prototype.post = function(t) {
                        var n;
                        return o.isString(t) && (t = {
                            message: t
                        }),
                            t = e.extend(!0, {}, this.messageDefaults, t),
                            n = this.newMessage(t),
                            n.update(t),
                            n
                    }
                    ,
                    n
            }(n),
            t = function(t) {
                function n() {
                    return n.__super__.constructor.apply(this, arguments)
                }
                return p(n, t),
                    n.prototype.doDefaults = {
                        progressMessage: null,
                        successMessage: null,
                        errorMessage: "Error connecting to the server.",
                        showSuccessWithoutError: !0,
                        retry: {
                            auto: !0,
                            allow: !0
                        },
                        action: e.ajax
                    },
                    n.prototype.hookBackboneAjax = function(t) {
                        var n, s = this;
                        if (null == t && (t = {}),
                            null == window.Backbone)
                            throw "Expected Backbone to be defined";
                        return t = o.defaults(t, {
                            id: "BACKBONE_ACTION",
                            errorMessage: !1,
                            successMessage: "Request completed successfully.",
                            showSuccessWithoutError: !1
                        }),
                            n = function(e) {
                                var n;
                                return n = o.extend({}, t, e.messenger),
                                    s["do"](n, e)
                            }
                            ,
                                null != Backbone.ajax ? (Backbone.ajax._withoutMessenger && (Backbone.ajax = Backbone.ajax._withoutMessenger),
                            (null == t.action || t.action === this.doDefaults.action) && (t.action = Backbone.ajax),
                            n._withoutMessenger = Backbone.ajax,
                            Backbone.ajax = n) : Backbone.sync = o.wrap(Backbone.sync, function() {
                            var t, s, r;
                            return r = arguments[0],
                                t = arguments.length >= 2 ? d.call(arguments, 1) : [],
                                s = e.ajax,
                                e.ajax = n,
                                r.call.apply(r, [this].concat(d.call(t))),
                                e.ajax = s
                        })
                    }
                    ,
                    n.prototype._getHandlerResponse = function(e) {
                        return e === !1 ? !1 : e === !0 || null == e ? !0 : e
                    }
                    ,
                    n.prototype._parseEvents = function(e) {
                        var t, n, s, r, o, i, a;
                        null == e && (e = {}),
                            o = {};
                        for (r in e)
                            s = e[r],
                                n = r.indexOf(" "),
                                i = r.substring(0, n),
                                t = r.substring(n + 1),
                                null == (a = o[i]) && (o[i] = {}),
                                o[i][t] = s;
                        return o
                    }
                    ,
                    n.prototype._normalizeResponse = function() {
                        var e, t, n, s, r, i, a;
                        for (n = arguments.length >= 1 ? d.call(arguments, 0) : [],
                                 s = null,
                                 r = null,
                                 e = null,
                                 i = 0,
                                 a = n.length; a > i; i++)
                            t = n[i],
                                    "success" === t || "timeout" === t || "abort" === t ? s = t : null != (null != t ? t.readyState : void 0) && null != (null != t ? t.responseText : void 0) ? r = t : o.isObject(t) && (e = t);
                        return [s, e, r]
                    }
                    ,
                    n.prototype.run = function() {
                        var t, n, s, r, i, a, l, u, c, h, p, g = this;
                        if (a = arguments[0],
                            c = arguments[1],
                            t = arguments.length >= 3 ? d.call(arguments, 2) : [],
                            null == c && (c = {}),
                            a = e.extend(!0, {}, this.messageDefaults, this.doDefaults, null != a ? a : {}),
                            n = this._parseEvents(a.events),
                            s = function(e, t) {
                                var n;
                                return n = a[e + "Message"],
                                    o.isFunction(n) ? n.call(g, e, t) : n
                            }
                            ,
                            l = null != (p = a.messageInstance) ? p : this.newMessage(a),
                            null != a.id && (l.options.id = a.id),
                            null != a.progressMessage && l.update(e.extend({}, a, {
                            message: s("progress", null),
                            type: "info"
                        })),
                            i = {},
                            o.each(["error", "success"], function(r) {
                                var u;
                                return u = c[r],
                                    i[r] = function() {
                                        var i, h, p, m, y, v, _, w, b, x, M, C, k, $, E;
                                        return v = arguments.length >= 1 ? d.call(arguments, 0) : [],
                                            b = g._normalizeResponse.apply(g, v),
                                            y = b[0],
                                            i = b[1],
                                            w = b[2],
                                            "success" === r && null == l.errorCount && a.showSuccessWithoutError === !1 && (a.successMessage = null),
                                            "error" === r && (null == (x = a.errorCount) && (a.errorCount = 0),
                                            a.errorCount += 1),
                                            p = a.returnsPromise ? v[0] : "function" == typeof u ? u.apply(null, v) : void 0,
                                            _ = g._getHandlerResponse(p),
                                            o.isString(_) && (_ = {
                                            message: _
                                        }),
                                                "error" !== r || 0 !== (null != w ? w.status : void 0) && "abort" !== y ? "error" === r && null != a.ignoredErrorCodes && (M = null != w ? w.status : void 0,
                                            f.call(a.ignoredErrorCodes, M) >= 0) ? (l.hide(),
                                            void 0) : (h = {
                                            message: s(r, w),
                                            type: r,
                                            events: null != (C = n[r]) ? C : {},
                                            hideOnNavigate: "success" === r
                                        },
                                            m = e.extend({}, a, h, _),
                                            "number" == typeof (null != (k = m.retry) ? k.allow : void 0) && m.retry.allow--,
                                                "error" === r && (null != w ? w.status : void 0) >= 500 && (null != ($ = m.retry) ? $.allow : void 0) ? (null == m.retry.delay && (m.retry.delay = 4 > m.errorCount ? 10 : 300),
                                            m.hideAfter && (null == (E = m._hideAfter) && (m._hideAfter = m.hideAfter),
                                            m.hideAfter = m._hideAfter + m.retry.delay),
                                            m._retryActions = !0,
                                            m.actions = {
                                                retry: {
                                                    label: "retry now",
                                                    phrase: "Retrying TIME",
                                                    auto: m.retry.auto,
                                                    delay: m.retry.delay,
                                                    action: function() {
                                                        return m.messageInstance = l,
                                                            setTimeout(function() {
                                                                return g["do"].apply(g, [m, c].concat(d.call(t)))
                                                            }, 0)
                                                    }
                                                },
                                                cancel: {
                                                    action: function() {
                                                        return l.cancel()
                                                    }
                                                }
                                            }) : m._retryActions && (delete m.actions.retry,
                                            delete m.actions.cancel,
                                            delete a._retryActions),
                                            l.update(m),
                                                _ && m.message ? (Messenger(o.extend({}, g.options, {
                                            instance: g
                                        })),
                                            l.show()) : l.hide()) : (l.hide(),
                                            void 0)
                                    }
                            }),
                            !a.returnsPromise)
                            for (h in i)
                                r = i[h],
                                    u = c[h],
                                    c[h] = r;
                        return l._actionInstance = a.action.apply(a, [c].concat(d.call(t))),
                            a.returnsPromise && l._actionInstance.then(i.success, i.error),
                            l
                    }
                    ,
                    n.prototype["do"] = n.prototype.run,
                    n.prototype.ajax = function() {
                        var t, n;
                        return n = arguments[0],
                            t = arguments.length >= 2 ? d.call(arguments, 1) : [],
                            n.action = e.ajax,
                            this.run.apply(this, [n].concat(d.call(t)))
                    }
                    ,
                    n.prototype.expectPromise = function(e, t) {
                        return t = o.extend({}, t, {
                            action: e,
                            returnsPromise: !0
                        }),
                            this.run(t)
                    }
                    ,
                    n.prototype.error = function(e) {
                        return null == e && (e = {}),
                            "string" == typeof e && (e = {
                            message: e
                        }),
                            e.type = "error",
                            this.post(e)
                    }
                    ,
                    n.prototype.info = function(e) {
                        return null == e && (e = {}),
                            "string" == typeof e && (e = {
                            message: e
                        }),
                            e.type = "info",
                            this.post(e)
                    }
                    ,
                    n.prototype.success = function(e) {
                        return null == e && (e = {}),
                            "string" == typeof e && (e = {
                            message: e
                        }),
                            e.type = "success",
                            this.post(e)
                    }
                    ,
                    n
            }(a),
            e.fn.messenger = function() {
                var n, s, r, i, l, u, c, h;
                return r = arguments[0],
                    s = arguments.length >= 2 ? d.call(arguments, 1) : [],
                    null == r && (r = {}),
                    n = this,
                        null != r && o.isString(r) ? (h = n.data("messenger"))[r].apply(h, s) : (l = r,
                    null == n.data("messenger") && (a = null != (u = null != (c = Messenger.themes[l.theme]) ? c.Messenger : void 0) ? u : t,
                    n.data("messenger", i = new a(e.extend({
                        el: n
                    }, l))),
                    i.render()),
                    n.data("messenger"))
            }
            ,
            window.Messenger._call = function(t) {
                var n, s, r, o, i, a, l, u, c, h, p;
                if (a = {
                    extraClasses: "messenger-fixed messenger-on-bottom messenger-on-right",
                    theme: "future",
                    maxMessages: 9,
                    parentLocations: ["body"]
                },
                    t = e.extend(a, e._messengerDefaults, Messenger.options, t),
                    null != t.theme && (t.extraClasses += " messenger-theme-" + t.theme),
                    l = t.instance || Messenger.instance,
                    null == t.instance) {
                    for (c = t.parentLocations,
                             s = null,
                             r = null,
                             h = 0,
                             p = c.length; p > h; h++)
                        if (u = c[h],
                            s = e(u),
                            s.length) {
                            o = u;
                            break
                        }
                    l ? e(l._location).is(e(o)) || (l.$el.detach(),
                        s.prepend(l.$el)) : (n = e("<ul>"),
                        s.prepend(n),
                        l = n.messenger(t),
                        l._location = o,
                        Messenger.instance = l)
                }
                return null != l._addedClasses && l.$el.removeClass(l._addedClasses),
                    l.$el.addClass(i = "" + l.className + " " + t.extraClasses),
                    l._addedClasses = i,
                    l
            }
            ,
            e.extend(Messenger, {
                Message: r,
                Messenger: t,
                themes: null != (c = Messenger.themes) ? c : {}
            }),
            e.globalMessenger = window.Messenger = Messenger
    }
        .call(this);
(function() {
    var $, FutureMessage, spinner_template, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) {
        for (var key in parent) {
            if (__hasProp.call(parent, key))
                child[key] = parent[key];
        }
        function ctor() {
            this.constructor = child;
        }
        ctor.prototype = parent.prototype;
        child.prototype = new ctor();
        child.__super__ = parent.prototype;
        return child;
    };
    $ = jQuery;
    spinner_template = '<div class="messenger-spinner">\n    <span class="messenger-spinner-side messenger-spinner-side-left">\n        <span class="messenger-spinner-fill"></span>\n    </span>\n    <span class="messenger-spinner-side messenger-spinner-side-right">\n        <span class="messenger-spinner-fill"></span>\n    </span>\n</div>';
    FutureMessage = (function(_super) {
        __extends(FutureMessage, _super);
        function FutureMessage() {
            return FutureMessage.__super__.constructor.apply(this, arguments);
        }
        FutureMessage.prototype.template = function(opts) {
            var $message;
            $message = FutureMessage.__super__.template.apply(this, arguments);
            $message.append($(spinner_template));
            return $message;
        }
        ;
        return FutureMessage;
    })(window.Messenger.Message);
    window.Messenger.themes.future = {
        Message: FutureMessage
    };
}
    ).call(this);
!function(e, t, n, i) {
    "use strict";
    t = "undefined" != typeof t && t.Math == Math ? t : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(),
        e.fn.dropdown = function(a) {
            var o, s = e(this), r = e(n), l = s.selector || "", c = "ontouchstart"in n.documentElement, u = (new Date).getTime(), d = [], v = arguments[0], m = "string" == typeof v, f = [].slice.call(arguments, 1);
            return s.each(function(h) {
                var g, p, b, w, x, C, S, y, A = e.isPlainObject(a) ? e.extend(!0, {}, e.fn.dropdown.settings, a) : e.extend({}, e.fn.dropdown.settings), T = A.className, k = A.message, L = A.fields, I = A.keys, D = A.metadata, q = A.namespace, R = A.regExp, O = A.selector, V = A.error, E = A.templates, F = "." + q, M = "module-" + q, z = e(this), P = e(A.context), H = z.find(O.text), j = z.find(O.search), U = z.find(O.sizer), N = z.find(O.input), K = z.find(O.icon), B = z.prev().find(O.text).length > 0 ? z.prev().find(O.text) : z.prev(), W = z.children(O.menu), $ = W.find(O.item), Q = !1, Y = !1, G = !1, J = this, X = z.data(M);
                y = {
                    initialize: function() {
                        y.debug("Initializing dropdown", A),
                            y.is.alreadySetup() ? y.setup.reference() : (y.setup.layout(),
                                y.refreshData(),
                                y.save.defaults(),
                                y.restore.selected(),
                                y.create.id(),
                                y.bind.events(),
                                y.observeChanges(),
                                y.instantiate())
                    },
                    instantiate: function() {
                        y.verbose("Storing instance of dropdown", y),
                            X = y,
                            z.data(M, y)
                    },
                    destroy: function() {
                        y.verbose("Destroying previous dropdown", z),
                            y.remove.tabbable(),
                            z.off(F).removeData(M),
                            W.off(F),
                            r.off(w),
                            y.disconnect.menuObserver(),
                            y.disconnect.selectObserver()
                    },
                    observeChanges: function() {
                        "MutationObserver"in t && (C = new MutationObserver(y.event.select.mutation),
                            S = new MutationObserver(y.event.menu.mutation),
                            y.debug("Setting up mutation observer", C, S),
                            y.observe.select(),
                            y.observe.menu())
                    },
                    disconnect: {
                        menuObserver: function() {
                            S && S.disconnect()
                        },
                        selectObserver: function() {
                            C && C.disconnect()
                        }
                    },
                    observe: {
                        select: function() {
                            y.has.input() && C.observe(N[0], {
                                childList: !0,
                                subtree: !0
                            })
                        },
                        menu: function() {
                            y.has.menu() && S.observe(W[0], {
                                childList: !0,
                                subtree: !0
                            })
                        }
                    },
                    create: {
                        id: function() {
                            x = (Math.random().toString(16) + "000000000").substr(2, 8),
                                w = "." + x,
                                y.verbose("Creating unique id for element", x)
                        },
                        userChoice: function(t) {
                            var n, a, o;
                            return !!(t = t || y.get.userValues()) && (t = e.isArray(t) ? t : [t],
                                e.each(t, function(t, s) {
                                    y.get.item(s) === !1 && (o = A.templates.addition(y.add.variables(k.addResult, s)),
                                        a = e("<div />").html(o).attr("data-" + D.value, s).attr("data-" + D.text, s).addClass(T.addition).addClass(T.item),
                                        A.hideAdditions && a.addClass(T.hidden),
                                        n = n === i ? a : n.add(a),
                                        y.verbose("Creating user choices for value", s, a))
                                }),
                                n)
                        },
                        userLabels: function(t) {
                            var n = y.get.userValues();
                            n && (y.debug("Adding user labels", n),
                                e.each(n, function(e, t) {
                                    y.verbose("Adding custom user value"),
                                        y.add.label(t, t)
                                }))
                        },
                        menu: function() {
                            W = e("<div />").addClass(T.menu).appendTo(z)
                        },
                        sizer: function() {
                            U = e("<span />").addClass(T.sizer).insertAfter(j)
                        }
                    },
                    search: function(e) {
                        e = e !== i ? e : y.get.query(),
                            y.verbose("Searching for query", e),
                            y.has.minCharacters(e) ? y.filter(e) : y.hide()
                    },
                    select: {
                        firstUnfiltered: function() {
                            y.verbose("Selecting first non-filtered element"),
                                y.remove.selectedItem(),
                                $.not(O.unselectable).not(O.addition + O.hidden).eq(0).addClass(T.selected)
                        },
                        nextAvailable: function(e) {
                            e = e.eq(0);
                            var t = e.nextAll(O.item).not(O.unselectable).eq(0)
                                , n = e.prevAll(O.item).not(O.unselectable).eq(0)
                                , i = t.length > 0;
                            i ? (y.verbose("Moving selection to", t),
                                t.addClass(T.selected)) : (y.verbose("Moving selection to", n),
                                n.addClass(T.selected))
                        }
                    },
                    setup: {
                        api: function() {
                            var e = {
                                debug: A.debug,
                                urlData: {
                                    value: y.get.value(),
                                    query: y.get.query()
                                },
                                on: !1
                            };
                            y.verbose("First request, initializing API"),
                                z.api(e)
                        },
                        layout: function() {
                            z.is("select") && (y.setup.select(),
                                y.setup.returnedObject()),
                                y.has.menu() || y.create.menu(),
                                y.is.search() && !y.has.search() && (y.verbose("Adding search input"),
                                j = e("<input />").addClass(T.search).prop("autocomplete", "off").insertBefore(H)),
                                y.is.multiple() && y.is.searchSelection() && !y.has.sizer() && y.create.sizer(),
                                A.allowTab && y.set.tabbable()
                        },
                        select: function() {
                            var t = y.get.selectValues();
                            y.debug("Dropdown initialized on a select", t),
                                z.is("select") && (N = z),
                                    N.parent(O.dropdown).length > 0 ? (y.debug("UI dropdown already exists. Creating dropdown menu only"),
                                z = N.closest(O.dropdown),
                                y.has.menu() || y.create.menu(),
                                W = z.children(O.menu),
                                y.setup.menu(t)) : (y.debug("Creating entire dropdown from select"),
                                z = e("<div />").attr("class", N.attr("class")).addClass(T.selection).addClass(T.dropdown).html(E.dropdown(t)).insertBefore(N),
                                N.hasClass(T.multiple) && N.prop("multiple") === !1 && (y.error(V.missingMultiple),
                                N.prop("multiple", !0)),
                                N.is("[multiple]") && y.set.multiple(),
                                N.prop("disabled") && (y.debug("Disabling dropdown"),
                                z.addClass(T.disabled)),
                                N.removeAttr("class").detach().prependTo(z)),
                                y.refresh()
                        },
                        menu: function(e) {
                            W.html(E.menu(e, L)),
                                $ = W.find(O.item)
                        },
                        reference: function() {
                            y.debug("Dropdown behavior was called on select, replacing with closest dropdown"),
                                z = z.parent(O.dropdown),
                                y.refresh(),
                                y.setup.returnedObject(),
                                m && (X = y,
                                y.invoke(v))
                        },
                        returnedObject: function() {
                            var e = s.slice(0, h)
                                , t = s.slice(h + 1);
                            s = e.add(z).add(t)
                        }
                    },
                    refresh: function() {
                        y.refreshSelectors(),
                            y.refreshData()
                    },
                    refreshItems: function() {
                        $ = W.find(O.item)
                    },
                    refreshSelectors: function() {
                        y.verbose("Refreshing selector cache"),
                            H = z.find(O.text),
                            j = z.find(O.search),
                            N = z.find(O.input),
                            K = z.find(O.icon),
                            B = z.prev().find(O.text).length > 0 ? z.prev().find(O.text) : z.prev(),
                            W = z.children(O.menu),
                            $ = W.find(O.item)
                    },
                    refreshData: function() {
                        y.verbose("Refreshing cached metadata"),
                            $.removeData(D.text).removeData(D.value)
                    },
                    clearData: function() {
                        y.verbose("Clearing metadata"),
                            $.removeData(D.text).removeData(D.value),
                            z.removeData(D.defaultText).removeData(D.defaultValue).removeData(D.placeholderText)
                    },
                    toggle: function() {
                        y.verbose("Toggling menu visibility"),
                            y.is.active() ? y.hide() : y.show()
                    },
                    show: function(t) {
                        if (t = e.isFunction(t) ? t : function() {}
                            ,
                            y.can.show() && !y.is.active()) {
                            if (y.debug("Showing dropdown"),
                                !y.has.message() || y.has.maxSelections() || y.has.allResultsFiltered() || y.remove.message(),
                                y.is.allFiltered())
                                return !0;
                            A.onShow.call(J) !== !1 && y.animate.show(function() {
                                y.can.click() && y.bind.intent(),
                                    y.has.menuSearch() && y.focusSearch(),
                                    y.set.visible(),
                                    t.call(J)
                            })
                        }
                    },
                    hide: function(t) {
                        t = e.isFunction(t) ? t : function() {}
                            ,
                            y.is.active() && (y.debug("Hiding dropdown"),
                            A.onHide.call(J) !== !1 && y.animate.hide(function() {
                            y.remove.visible(),
                                t.call(J)
                        }))
                    },
                    hideOthers: function() {
                        y.verbose("Finding other dropdowns to hide"),
                            s.not(z).has(O.menu + "." + T.visible).dropdown("hide")
                    },
                    hideMenu: function() {
                        y.verbose("Hiding menu  instantaneously"),
                            y.remove.active(),
                            y.remove.visible(),
                            W.transition("hide")
                    },
                    hideSubMenus: function() {
                        var e = W.children(O.item).find(O.menu);
                        y.verbose("Hiding sub menus", e),
                            e.transition("hide")
                    },
                    bind: {
                        events: function() {
                            c && y.bind.touchEvents(),
                                y.bind.keyboardEvents(),
                                y.bind.inputEvents(),
                                y.bind.mouseEvents()
                        },
                        touchEvents: function() {
                            y.debug("Touch device detected binding additional touch events"),
                                y.is.searchSelection() || y.is.single() && z.on("touchstart" + F, y.event.test.toggle),
                                W.on("touchstart" + F, O.item, y.event.item.mouseenter)
                        },
                        keyboardEvents: function() {
                            y.verbose("Binding keyboard events"),
                                z.on("keydown" + F, y.event.keydown),
                                y.has.search() && z.on(y.get.inputEvent() + F, O.search, y.event.input),
                                y.is.multiple() && r.on("keydown" + w, y.event.document.keydown)
                        },
                        inputEvents: function() {
                            y.verbose("Binding input change events"),
                                z.on("change" + F, O.input, y.event.change)
                        },
                        mouseEvents: function() {
                            y.verbose("Binding mouse events"),
                                y.is.multiple() && z.on("click" + F, O.label, y.event.label.click).on("click" + F, O.remove, y.event.remove.click),
                                y.is.searchSelection() ? (z.on("mousedown" + F, y.event.mousedown).on("mouseup" + F, y.event.mouseup).on("mousedown" + F, O.menu, y.event.menu.mousedown).on("mouseup" + F, O.menu, y.event.menu.mouseup).on("click" + F, O.icon, y.event.icon.click).on("focus" + F, O.search, y.event.search.focus).on("click" + F, O.search, y.event.search.focus).on("blur" + F, O.search, y.event.search.blur).on("click" + F, O.text, y.event.text.focus),
                                    y.is.multiple() && z.on("click" + F, y.event.click)) : ("click" == A.on ? z.on("click" + F, O.icon, y.event.icon.click).on("click" + F, y.event.test.toggle) : "hover" == A.on ? z.on("mouseenter" + F, y.delay.show).on("mouseleave" + F, y.delay.hide) : z.on(A.on + F, y.toggle),
                                    z.on("mousedown" + F, y.event.mousedown).on("mouseup" + F, y.event.mouseup).on("focus" + F, y.event.focus).on("blur" + F, y.event.blur)),
                                W.on("mouseenter" + F, O.item, y.event.item.mouseenter).on("mouseleave" + F, O.item, y.event.item.mouseleave).on("click" + F, O.item, y.event.item.click)
                        },
                        intent: function() {
                            y.verbose("Binding hide intent event to document"),
                                c && r.on("touchstart" + w, y.event.test.touch).on("touchmove" + w, y.event.test.touch),
                                r.on("click" + w, y.event.test.hide)
                        }
                    },
                    unbind: {
                        intent: function() {
                            y.verbose("Removing hide intent event from document"),
                                c && r.off("touchstart" + w).off("touchmove" + w),
                                r.off("click" + w)
                        }
                    },
                    filter: function(e) {
                        var t = e !== i ? e : y.get.query()
                            , n = function() {
                                y.is.multiple() && y.filterActive(),
                                    y.select.firstUnfiltered(),
                                    y.has.allResultsFiltered() ? A.onNoResults.call(J, t) ? A.allowAdditions ? A.hideAdditions && (y.verbose("User addition with no menu, setting empty style"),
                                        y.set.empty(),
                                        y.hideMenu()) : (y.verbose("All items filtered, showing message", t),
                                        y.add.message(k.noResults)) : (y.verbose("All items filtered, hiding dropdown", t),
                                        y.hideMenu()) : (y.remove.empty(),
                                        y.remove.message()),
                                    A.allowAdditions && y.add.userSuggestion(e),
                                    y.is.searchSelection() && y.can.show() && y.is.focusedOnSearch() && y.show()
                            };
                        A.useLabels && y.has.maxSelections() || (A.apiSettings ? y.can.useAPI() ? y.queryRemote(t, function() {
                            n()
                        }) : y.error(V.noAPI) : (y.filterItems(t),
                            n()))
                    },
                    queryRemote: function(t, n) {
                        var i = {
                            errorDuration: !1,
                            cache: "local",
                            throttle: A.throttle,
                            urlData: {
                                query: t
                            },
                            onError: function() {
                                y.add.message(k.serverError),
                                    n()
                            },
                            onFailure: function() {
                                y.add.message(k.serverError),
                                    n()
                            },
                            onSuccess: function(e) {
                                y.remove.message(),
                                    y.setup.menu({
                                        values: e[L.remoteValues]
                                    }),
                                    n()
                            }
                        };
                        z.api("get request") || y.setup.api(),
                            i = e.extend(!0, {}, i, A.apiSettings),
                            z.api("setting", i).api("query")
                    },
                    filterItems: function(t) {
                        var n = t !== i ? t : y.get.query()
                            , a = null
                            , o = y.escape.regExp(n)
                            , s = new RegExp("^" + o,"igm");
                        y.has.query() && (a = [],
                            y.verbose("Searching for matching values", n),
                            $.each(function() {
                                var t, i, o = e(this);
                                if ("both" == A.match || "text" == A.match) {
                                    if (t = String(y.get.choiceText(o, !1)),
                                        t.search(s) !== -1)
                                        return a.push(this),
                                            !0;
                                    if ("exact" === A.fullTextSearch && y.exactSearch(n, t))
                                        return a.push(this),
                                            !0;
                                    if (A.fullTextSearch === !0 && y.fuzzySearch(n, t))
                                        return a.push(this),
                                            !0
                                }
                                if ("both" == A.match || "value" == A.match) {
                                    if (i = String(y.get.choiceValue(o, t)),
                                        i.search(s) !== -1)
                                        return a.push(this),
                                            !0;
                                    if (A.fullTextSearch && y.fuzzySearch(n, i))
                                        return a.push(this),
                                            !0
                                }
                            })),
                            y.debug("Showing only matched items", n),
                            y.remove.filteredItem(),
                            a && $.not(a).addClass(T.filtered)
                    },
                    fuzzySearch: function(e, t) {
                        var n = t.length
                            , i = e.length;
                        if (e = e.toLowerCase(),
                            t = t.toLowerCase(),
                            i > n)
                            return !1;
                        if (i === n)
                            return e === t;
                        e: for (var a = 0, o = 0; a < i; a++) {
                            for (var s = e.charCodeAt(a); o < n; )
                                if (t.charCodeAt(o++) === s)
                                    continue e;
                            return !1
                        }
                        return !0
                    },
                    exactSearch: function(e, t) {
                        return e = e.toLowerCase(),
                            t = t.toLowerCase(),
                            t.indexOf(e) > -1
                    },
                    filterActive: function() {
                        A.useLabels && $.filter("." + T.active).addClass(T.filtered)
                    },
                    focusSearch: function(e) {
                        y.has.search() && !y.is.focusedOnSearch() && (e ? (z.off("focus" + F, O.search),
                            j.focus(),
                            z.on("focus" + F, O.search, y.event.search.focus)) : j.focus())
                    },
                    forceSelection: function() {
                        var e = $.not(T.filtered).filter("." + T.selected).eq(0)
                            , t = $.not(T.filtered).filter("." + T.active).eq(0)
                            , n = e.length > 0 ? e : t
                            , i = n.length > 0;
                        return i ? (y.debug("Forcing partial selection to selected item", n),
                            void y.event.item.click.call(n, {}, !0)) : void (A.allowAdditions ? (y.set.selected(y.get.query()),
                            y.remove.searchTerm()) : y.remove.searchTerm())
                    },
                    event: {
                        change: function() {
                            G || (y.debug("Input changed, updating selection"),
                                y.set.selected())
                        },
                        focus: function() {
                            A.showOnFocus && !Q && y.is.hidden() && !p && y.show()
                        },
                        blur: function(e) {
                            p = n.activeElement === this,
                                Q || p || (y.remove.activeLabel(),
                                y.hide())
                        },
                        mousedown: function() {
                            y.is.searchSelection() ? b = !0 : Q = !0
                        },
                        mouseup: function() {
                            y.is.searchSelection() ? b = !1 : Q = !1
                        },
                        click: function(t) {
                            var n = e(t.target);
                            n.is(z) && (y.is.focusedOnSearch() ? y.show() : y.focusSearch())
                        },
                        search: {
                            focus: function() {
                                Q = !0,
                                    y.is.multiple() && y.remove.activeLabel(),
                                    A.showOnFocus && y.search()
                            },
                            blur: function(e) {
                                p = n.activeElement === this,
                                    b || Y || p || (A.forceSelection && y.forceSelection(),
                                    y.hide()),
                                    b = !1
                            }
                        },
                        icon: {
                            click: function(e) {
                                y.toggle()
                            }
                        },
                        text: {
                            focus: function(e) {
                                Q = !0,
                                    y.focusSearch()
                            }
                        },
                        input: function(e) {
                            (y.is.multiple() || y.is.searchSelection()) && y.set.filtered(),
                                clearTimeout(y.timer),
                                y.timer = setTimeout(y.search, A.delay.search)
                        },
                        label: {
                            click: function(t) {
                                var n = e(this)
                                    , i = z.find(O.label)
                                    , a = i.filter("." + T.active)
                                    , o = n.nextAll("." + T.active)
                                    , s = n.prevAll("." + T.active)
                                    , r = o.length > 0 ? n.nextUntil(o).add(a).add(n) : n.prevUntil(s).add(a).add(n);
                                t.shiftKey ? (a.removeClass(T.active),
                                    r.addClass(T.active)) : t.ctrlKey ? n.toggleClass(T.active) : (a.removeClass(T.active),
                                    n.addClass(T.active)),
                                    A.onLabelSelect.apply(this, i.filter("." + T.active))
                            }
                        },
                        remove: {
                            click: function() {
                                var t = e(this).parent();
                                t.hasClass(T.active) ? y.remove.activeLabels() : y.remove.activeLabels(t)
                            }
                        },
                        test: {
                            toggle: function(e) {
                                var t = y.is.multiple() ? y.show : y.toggle;
                                y.is.bubbledLabelClick(e) || y.is.bubbledIconClick(e) || y.determine.eventOnElement(e, t) && e.preventDefault()
                            },
                            touch: function(e) {
                                y.determine.eventOnElement(e, function() {
                                    "touchstart" == e.type ? y.timer = setTimeout(function() {
                                        y.hide()
                                    }, A.delay.touch) : "touchmove" == e.type && clearTimeout(y.timer)
                                }),
                                    e.stopPropagation()
                            },
                            hide: function(e) {
                                y.determine.eventInModule(e, y.hide)
                            }
                        },
                        select: {
                            mutation: function(e) {
                                y.debug("<select> modified, recreating menu"),
                                    y.setup.select()
                            }
                        },
                        menu: {
                            mutation: function(t) {
                                var n = t[0]
                                    , i = e(n.addedNodes ? n.addedNodes[0] : !1)
                                    , a = e(n.removedNodes ? n.removedNodes[0] : !1)
                                    , o = i.add(a)
                                    , s = o.is(O.addition) || o.closest(O.addition).length > 0
                                    , r = o.is(O.message) || o.closest(O.message).length > 0;
                                s || r ? (y.debug("Updating item selector cache"),
                                    y.refreshItems()) : (y.debug("Menu modified, updating selector cache"),
                                    y.refresh())
                            },
                            mousedown: function() {
                                Y = !0
                            },
                            mouseup: function() {
                                Y = !1
                            }
                        },
                        item: {
                            mouseenter: function(t) {
                                var n = e(t.target)
                                    , i = e(this)
                                    , a = i.children(O.menu)
                                    , o = i.siblings(O.item).children(O.menu)
                                    , s = a.length > 0
                                    , r = a.find(n).length > 0;
                                !r && s && (clearTimeout(y.itemTimer),
                                    y.itemTimer = setTimeout(function() {
                                        y.verbose("Showing sub-menu", a),
                                            e.each(o, function() {
                                                y.animate.hide(!1, e(this))
                                            }),
                                            y.animate.show(!1, a)
                                    }, A.delay.show),
                                    t.preventDefault())
                            },
                            mouseleave: function(t) {
                                var n = e(this).children(O.menu);
                                n.length > 0 && (clearTimeout(y.itemTimer),
                                    y.itemTimer = setTimeout(function() {
                                        y.verbose("Hiding sub-menu", n),
                                            y.animate.hide(!1, n)
                                    }, A.delay.hide))
                            },
                            click: function(t, n) {
                                var i = e(this)
                                    , a = e(t ? t.target : "")
                                    , o = i.find(O.menu)
                                    , s = y.get.choiceText(i)
                                    , r = y.get.choiceValue(i, s)
                                    , l = o.length > 0
                                    , c = o.find(a).length > 0;
                                c || l && !A.allowCategorySelection || (y.is.searchSelection() && (A.allowAdditions && y.remove.userAddition(),
                                    y.remove.searchTerm(),
                                    y.is.focusedOnSearch() || 1 == n || y.focusSearch(!0)),
                                    A.useLabels || (y.remove.filteredItem(),
                                    y.set.scrollPosition(i)),
                                    y.determine.selectAction.call(this, s, r))
                            }
                        },
                        document: {
                            keydown: function(e) {
                                var t = e.which
                                    , n = y.is.inObject(t, I);
                                if (n) {
                                    var i = z.find(O.label)
                                        , a = i.filter("." + T.active)
                                        , o = (a.data(D.value),
                                            i.index(a))
                                        , s = i.length
                                        , r = a.length > 0
                                        , l = a.length > 1
                                        , c = 0 === o
                                        , u = o + 1 == s
                                        , d = y.is.searchSelection()
                                        , v = y.is.focusedOnSearch()
                                        , m = y.is.focused()
                                        , f = v && 0 === y.get.caretPosition();
                                    if (d && !r && !v)
                                        return;
                                    t == I.leftArrow ? !m && !f || r ? r && (e.shiftKey ? y.verbose("Adding previous label to selection") : (y.verbose("Selecting previous label"),
                                        i.removeClass(T.active)),
                                            c && !l ? a.addClass(T.active) : a.prev(O.siblingLabel).addClass(T.active).end(),
                                        e.preventDefault()) : (y.verbose("Selecting previous label"),
                                        i.last().addClass(T.active)) : t == I.rightArrow ? (m && !r && i.first().addClass(T.active),
                                        r && (e.shiftKey ? y.verbose("Adding next label to selection") : (y.verbose("Selecting next label"),
                                        i.removeClass(T.active)),
                                        u ? d ? v ? i.removeClass(T.active) : y.focusSearch() : l ? a.next(O.siblingLabel).addClass(T.active) : a.addClass(T.active) : a.next(O.siblingLabel).addClass(T.active),
                                        e.preventDefault())) : t == I.deleteKey || t == I.backspace ? r ? (y.verbose("Removing active labels"),
                                        u && d && !v && y.focusSearch(),
                                        a.last().next(O.siblingLabel).addClass(T.active),
                                        y.remove.activeLabels(a),
                                        e.preventDefault()) : f && !r && t == I.backspace && (y.verbose("Removing last label on input backspace"),
                                        a = i.last().addClass(T.active),
                                        y.remove.activeLabels(a)) : a.removeClass(T.active)
                                }
                            }
                        },
                        keydown: function(e) {
                            var t = e.which
                                , n = y.is.inObject(t, I);
                            if (n) {
                                var i, a, o = $.not(O.unselectable).filter("." + T.selected).eq(0), s = W.children("." + T.active).eq(0), r = o.length > 0 ? o : s, l = r.length > 0 ? r.siblings(":not(." + T.filtered + ")").addBack() : W.children(":not(." + T.filtered + ")"), c = r.children(O.menu), u = r.closest(O.menu), d = u.hasClass(T.visible) || u.hasClass(T.animating) || u.parent(O.menu).length > 0, v = c.length > 0, m = r.length > 0, f = r.not(O.unselectable).length > 0, h = t == I.delimiter && A.allowAdditions && y.is.multiple(), g = A.allowAdditions && A.hideAdditions && (t == I.enter || h) && f;
                                if (g && (y.verbose("Selecting item from keyboard shortcut", r),
                                    y.event.item.click.call(r, e),
                                    y.is.searchSelection() && y.remove.searchTerm()),
                                    y.is.visible()) {
                                    if ((t == I.enter || h) && (t == I.enter && m && v && !A.allowCategorySelection ? (y.verbose("Pressed enter on unselectable category, opening sub menu"),
                                        t = I.rightArrow) : f && (y.verbose("Selecting item from keyboard shortcut", r),
                                        y.event.item.click.call(r, e),
                                        y.is.searchSelection() && y.remove.searchTerm()),
                                        e.preventDefault()),
                                        m && (t == I.leftArrow && (a = u[0] !== W[0],
                                        a && (y.verbose("Left key pressed, closing sub-menu"),
                                        y.animate.hide(!1, u),
                                        r.removeClass(T.selected),
                                        u.closest(O.item).addClass(T.selected),
                                        e.preventDefault())),
                                        t == I.rightArrow && v && (y.verbose("Right key pressed, opening sub-menu"),
                                        y.animate.show(!1, c),
                                        r.removeClass(T.selected),
                                        c.find(O.item).eq(0).addClass(T.selected),
                                        e.preventDefault())),
                                        t == I.upArrow) {
                                        if (i = m && d ? r.prevAll(O.item + ":not(" + O.unselectable + ")").eq(0) : $.eq(0),
                                            l.index(i) < 0)
                                            return y.verbose("Up key pressed but reached top of current menu"),
                                                void e.preventDefault();
                                        y.verbose("Up key pressed, changing active item"),
                                            r.removeClass(T.selected),
                                            i.addClass(T.selected),
                                            y.set.scrollPosition(i),
                                            A.selectOnKeydown && y.is.single() && y.set.selectedItem(i),
                                            e.preventDefault()
                                    }
                                    if (t == I.downArrow) {
                                        if (i = m && d ? i = r.nextAll(O.item + ":not(" + O.unselectable + ")").eq(0) : $.eq(0),
                                            0 === i.length)
                                            return y.verbose("Down key pressed but reached bottom of current menu"),
                                                void e.preventDefault();
                                        y.verbose("Down key pressed, changing active item"),
                                            $.removeClass(T.selected),
                                            i.addClass(T.selected),
                                            y.set.scrollPosition(i),
                                            A.selectOnKeydown && y.is.single() && y.set.selectedItem(i),
                                            e.preventDefault()
                                    }
                                    t == I.pageUp && (y.scrollPage("up"),
                                        e.preventDefault()),
                                        t == I.pageDown && (y.scrollPage("down"),
                                        e.preventDefault()),
                                        t == I.escape && (y.verbose("Escape key pressed, closing dropdown"),
                                        y.hide())
                                } else
                                    h && e.preventDefault(),
                                        t != I.downArrow || y.is.visible() || (y.verbose("Down key pressed, showing dropdown"),
                                        y.select.firstUnfiltered(),
                                        y.show(),
                                        e.preventDefault())
                            } else
                                y.has.search() || y.set.selectedLetter(String.fromCharCode(t))
                        }
                    },
                    trigger: {
                        change: function() {
                            var e = n.createEvent("HTMLEvents")
                                , t = N[0];
                            t && (y.verbose("Triggering native change event"),
                                e.initEvent("change", !0, !1),
                                t.dispatchEvent(e))
                        }
                    },
                    determine: {
                        selectAction: function(t, n) {
                            y.verbose("Determining action", A.action),
                                e.isFunction(y.action[A.action]) ? (y.verbose("Triggering preset action", A.action, t, n),
                                    y.action[A.action].call(J, t, n, this)) : e.isFunction(A.action) ? (y.verbose("Triggering user action", A.action, t, n),
                                    A.action.call(J, t, n, this)) : y.error(V.action, A.action)
                        },
                        eventInModule: function(t, i) {
                            var a = e(t.target)
                                , o = a.closest(n.documentElement).length > 0
                                , s = a.closest(z).length > 0;
                            return i = e.isFunction(i) ? i : function() {}
                                ,
                                    o && !s ? (y.verbose("Triggering event", i),
                                i(),
                                !0) : (y.verbose("Event occurred in dropdown, canceling callback"),
                                !1)
                        },
                        eventOnElement: function(t, i) {
                            var a = e(t.target)
                                , o = a.closest(O.siblingLabel)
                                , s = n.body.contains(t.target)
                                , r = 0 === z.find(o).length
                                , l = 0 === a.closest(W).length;
                            return i = e.isFunction(i) ? i : function() {}
                                ,
                                    s && r && l ? (y.verbose("Triggering event", i),
                                i(),
                                !0) : (y.verbose("Event occurred in dropdown menu, canceling callback"),
                                !1)
                        }
                    },
                    action: {
                        nothing: function() {},
                        activate: function(t, n, a) {
                            if (n = n !== i ? n : t,
                                y.can.activate(e(a))) {
                                if (y.set.selected(n, e(a)),
                                    y.is.multiple() && !y.is.allFiltered())
                                    return;
                                y.hideAndClear()
                            }
                        },
                        select: function(t, n, a) {
                            if (n = n !== i ? n : t,
                                y.can.activate(e(a))) {
                                if (y.set.value(n, e(a)),
                                    y.is.multiple() && !y.is.allFiltered())
                                    return;
                                y.hideAndClear()
                            }
                        },
                        combo: function(t, n, a) {
                            n = n !== i ? n : t,
                                y.set.selected(n, e(a)),
                                y.hideAndClear()
                        },
                        hide: function(e, t, n) {
                            y.set.value(t, e),
                                y.hideAndClear()
                        }
                    },
                    get: {
                        id: function() {
                            return x
                        },
                        defaultText: function() {
                            return z.data(D.defaultText)
                        },
                        defaultValue: function() {
                            return z.data(D.defaultValue)
                        },
                        placeholderText: function() {
                            return z.data(D.placeholderText) || ""
                        },
                        text: function() {
                            return H.text()
                        },
                        query: function() {
                            return e.trim(j.val())
                        },
                        searchWidth: function(e) {
                            return e = e !== i ? e : j.val(),
                                U.text(e),
                                Math.ceil(U.width() + 1)
                        },
                        selectionCount: function() {
                            var t, n = y.get.values();
                            return t = y.is.multiple() ? e.isArray(n) ? n.length : 0 : "" !== y.get.value() ? 1 : 0
                        },
                        transition: function(e) {
                            return "auto" == A.transition ? y.is.upward(e) ? "slide up" : "slide down" : A.transition
                        },
                        userValues: function() {
                            var t = y.get.values();
                            return !!t && (t = e.isArray(t) ? t : [t],
                                e.grep(t, function(e) {
                                    return y.get.item(e) === !1
                                }))
                        },
                        uniqueArray: function(t) {
                            return e.grep(t, function(n, i) {
                                return e.inArray(n, t) === i
                            })
                        },
                        caretPosition: function() {
                            var e, t, i = j.get(0);
                            return "selectionStart"in i ? i.selectionStart : n.selection ? (i.focus(),
                                e = n.selection.createRange(),
                                t = e.text.length,
                                e.moveStart("character", -i.value.length),
                                e.text.length - t) : void 0
                        },
                        value: function() {
                            var t = N.length > 0 ? N.val() : z.data(D.value)
                                , n = e.isArray(t) && 1 === t.length && "" === t[0];
                            return t === i || n ? "" : t
                        },
                        values: function() {
                            var e = y.get.value();
                            return "" === e ? "" : !y.has.selectInput() && y.is.multiple() ? "string" == typeof e ? e.split(A.delimiter) : "" : e
                        },
                        remoteValues: function() {
                            var t = y.get.values()
                                , n = !1;
                            return t && ("string" == typeof t && (t = [t]),
                                e.each(t, function(e, t) {
                                    var i = y.read.remoteData(t);
                                    y.verbose("Restoring value from session data", i, t),
                                        i && (n || (n = {}),
                                        n[t] = i)
                                })),
                                n
                        },
                        choiceText: function(t, n) {
                            if (n = n !== i ? n : A.preserveHTML,
                                t)
                                return t.find(O.menu).length > 0 && (y.verbose("Retrieving text of element with sub-menu"),
                                    t = t.clone(),
                                    t.find(O.menu).remove(),
                                    t.find(O.menuIcon).remove()),
                                        t.data(D.text) !== i ? t.data(D.text) : n ? e.trim(t.html()) : e.trim(t.text())
                        },
                        choiceValue: function(t, n) {
                            return n = n || y.get.choiceText(t),
                                !!t && (t.data(D.value) !== i ? String(t.data(D.value)) : "string" == typeof n ? e.trim(n.toLowerCase()) : String(n))
                        },
                        inputEvent: function() {
                            var e = j[0];
                            return !!e && (e.oninput !== i ? "input" : e.onpropertychange !== i ? "propertychange" : "keyup")
                        },
                        selectValues: function() {
                            var t = {};
                            return t.values = [],
                                z.find("option").each(function() {
                                    var n = e(this)
                                        , a = n.html()
                                        , o = n.attr("disabled")
                                        , s = n.attr("value") !== i ? n.attr("value") : a;
                                    "auto" === A.placeholder && "" === s ? t.placeholder = a : t.values.push({
                                        name: a,
                                        value: s,
                                        disabled: o
                                    })
                                }),
                                A.placeholder && "auto" !== A.placeholder && (y.debug("Setting placeholder value to", A.placeholder),
                                t.placeholder = A.placeholder),
                                A.sortSelect ? (t.values.sort(function(e, t) {
                                    return e.name > t.name ? 1 : -1
                                }),
                                    y.debug("Retrieved and sorted values from select", t)) : y.debug("Retrieved values from select", t),
                                t
                        },
                        activeItem: function() {
                            return $.filter("." + T.active)
                        },
                        selectedItem: function() {
                            var e = $.not(O.unselectable).filter("." + T.selected);
                            return e.length > 0 ? e : $.eq(0)
                        },
                        itemWithAdditions: function(e) {
                            var t = y.get.item(e)
                                , n = y.create.userChoice(e)
                                , i = n && n.length > 0;
                            return i && (t = t.length > 0 ? t.add(n) : n),
                                t
                        },
                        item: function(t, n) {
                            var a, o, s = !1;
                            return t = t !== i ? t : y.get.values() !== i ? y.get.values() : y.get.text(),
                                a = o ? t.length > 0 : t !== i && null !== t,
                                o = y.is.multiple() && e.isArray(t),
                                n = "" === t || 0 === t || (n || !1),
                                a && $.each(function() {
                                var a = e(this)
                                    , r = y.get.choiceText(a)
                                    , l = y.get.choiceValue(a, r);
                                if (null !== l && l !== i)
                                    if (o)
                                        e.inArray(String(l), t) === -1 && e.inArray(r, t) === -1 || (s = s ? s.add(a) : a);
                                    else if (n) {
                                        if (y.verbose("Ambiguous dropdown value using strict type check", a, t),
                                            l === t || r === t)
                                            return s = a,
                                                !0
                                    } else if (String(l) == String(t) || r == t)
                                        return y.verbose("Found select item by value", l, t),
                                            s = a,
                                            !0
                            }),
                                s
                        }
                    },
                    check: {
                        maxSelections: function(e) {
                            return !A.maxSelections || (e = e !== i ? e : y.get.selectionCount(),
                                    e >= A.maxSelections ? (y.debug("Maximum selection count reached"),
                                A.useLabels && ($.addClass(T.filtered),
                                y.add.message(k.maxSelections)),
                                !0) : (y.verbose("No longer at maximum selection count"),
                                y.remove.message(),
                                y.remove.filteredItem(),
                                y.is.searchSelection() && y.filterItems(),
                                !1))
                        }
                    },
                    restore: {
                        defaults: function() {
                            y.clear(),
                                y.restore.defaultText(),
                                y.restore.defaultValue()
                        },
                        defaultText: function() {
                            var e = y.get.defaultText()
                                , t = y.get.placeholderText;
                            e === t ? (y.debug("Restoring default placeholder text", e),
                                y.set.placeholderText(e)) : (y.debug("Restoring default text", e),
                                y.set.text(e))
                        },
                        placeholderText: function() {
                            y.set.placeholderText()
                        },
                        defaultValue: function() {
                            var e = y.get.defaultValue();
                            e !== i && (y.debug("Restoring default value", e),
                                    "" !== e ? (y.set.value(e),
                                y.set.selected()) : (y.remove.activeItem(),
                                y.remove.selectedItem()))
                        },
                        labels: function() {
                            A.allowAdditions && (A.useLabels || (y.error(V.labels),
                                A.useLabels = !0),
                                y.debug("Restoring selected values"),
                                y.create.userLabels()),
                                y.check.maxSelections()
                        },
                        selected: function() {
                            y.restore.values(),
                                y.is.multiple() ? (y.debug("Restoring previously selected values and labels"),
                                    y.restore.labels()) : y.debug("Restoring previously selected values")
                        },
                        values: function() {
                            y.set.initialLoad(),
                                    A.apiSettings && A.saveRemoteData && y.get.remoteValues() ? y.restore.remoteValues() : y.set.selected(),
                                y.remove.initialLoad()
                        },
                        remoteValues: function() {
                            var t = y.get.remoteValues();
                            y.debug("Recreating selected from session data", t),
                                t && (y.is.single() ? e.each(t, function(e, t) {
                                y.set.text(t)
                            }) : e.each(t, function(e, t) {
                                y.add.label(e, t)
                            }))
                        }
                    },
                    read: {
                        remoteData: function(e) {
                            var n;
                            return t.Storage === i ? void y.error(V.noStorage) : (n = sessionStorage.getItem(e),
                                n !== i && n)
                        }
                    },
                    save: {
                        defaults: function() {
                            y.save.defaultText(),
                                y.save.placeholderText(),
                                y.save.defaultValue()
                        },
                        defaultValue: function() {
                            var e = y.get.value();
                            y.verbose("Saving default value as", e),
                                z.data(D.defaultValue, e)
                        },
                        defaultText: function() {
                            var e = y.get.text();
                            y.verbose("Saving default text as", e),
                                z.data(D.defaultText, e)
                        },
                        placeholderText: function() {
                            var e;
                            A.placeholder !== !1 && H.hasClass(T.placeholder) && (e = y.get.text(),
                                y.verbose("Saving placeholder text as", e),
                                z.data(D.placeholderText, e))
                        },
                        remoteData: function(e, n) {
                            return t.Storage === i ? void y.error(V.noStorage) : (y.verbose("Saving remote data to session storage", n, e),
                                void sessionStorage.setItem(n, e))
                        }
                    },
                    clear: function() {
                        y.is.multiple() && A.useLabels ? y.remove.labels() : (y.remove.activeItem(),
                            y.remove.selectedItem()),
                            y.set.placeholderText(),
                            y.clearValue()
                    },
                    clearValue: function() {
                        y.set.value("")
                    },
                    scrollPage: function(e, t) {
                        var n, i, a, o = t || y.get.selectedItem(), s = o.closest(O.menu), r = s.outerHeight(), l = s.scrollTop(), c = $.eq(0).outerHeight(), u = Math.floor(r / c), d = (s.prop("scrollHeight"),
                                "up" == e ? l - c * u : l + c * u), v = $.not(O.unselectable);
                        a = "up" == e ? v.index(o) - u : v.index(o) + u,
                            n = "up" == e ? a >= 0 : a < v.length,
                            i = n ? v.eq(a) : "up" == e ? v.first() : v.last(),
                            i.length > 0 && (y.debug("Scrolling page", e, i),
                            o.removeClass(T.selected),
                            i.addClass(T.selected),
                            A.selectOnKeydown && y.is.single() && y.set.selectedItem(i),
                            s.scrollTop(d))
                    },
                    set: {
                        filtered: function() {
                            var e = y.is.multiple()
                                , t = y.is.searchSelection()
                                , n = e && t
                                , i = t ? y.get.query() : ""
                                , a = "string" == typeof i && i.length > 0
                                , o = y.get.searchWidth()
                                , s = "" !== i;
                            e && a && (y.verbose("Adjusting input width", o, A.glyphWidth),
                                j.css("width", o)),
                                    a || n && s ? (y.verbose("Hiding placeholder text"),
                                H.addClass(T.filtered)) : (!e || n && !s) && (y.verbose("Showing placeholder text"),
                                H.removeClass(T.filtered))
                        },
                        empty: function() {
                            z.addClass(T.empty)
                        },
                        loading: function() {
                            z.addClass(T.loading)
                        },
                        placeholderText: function(e) {
                            e = e || y.get.placeholderText(),
                                y.debug("Setting placeholder text", e),
                                y.set.text(e),
                                H.addClass(T.placeholder)
                        },
                        tabbable: function() {
                            y.has.search() ? (y.debug("Added tabindex to searchable dropdown"),
                                j.val("").attr("tabindex", 0),
                                W.attr("tabindex", -1)) : (y.debug("Added tabindex to dropdown"),
                                z.attr("tabindex") === i && (z.attr("tabindex", 0),
                                W.attr("tabindex", -1)))
                        },
                        initialLoad: function() {
                            y.verbose("Setting initial load"),
                                g = !0
                        },
                        activeItem: function(e) {
                            A.allowAdditions && e.filter(O.addition).length > 0 ? e.addClass(T.filtered) : e.addClass(T.active)
                        },
                        partialSearch: function(e) {
                            var t = y.get.query().length;
                            j.val(e.substr(0, t))
                        },
                        scrollPosition: function(e, t) {
                            var n, a, o, s, r, l, c, u, d, v = 5;
                            e = e || y.get.selectedItem(),
                                n = e.closest(O.menu),
                                a = e && e.length > 0,
                                t = t !== i && t,
                                e && n.length > 0 && a && (s = e.position().top,
                                n.addClass(T.loading),
                                l = n.scrollTop(),
                                r = n.offset().top,
                                s = e.offset().top,
                                o = l - r + s,
                                t || (c = n.height(),
                                d = l + c < o + v,
                                u = o - v < l),
                                y.debug("Scrolling to active item", o),
                                (t || u || d) && n.scrollTop(o),
                                n.removeClass(T.loading))
                        },
                        text: function(e) {
                            "select" !== A.action && ("combo" == A.action ? (y.debug("Changing combo button text", e, B),
                                A.preserveHTML ? B.html(e) : B.text(e)) : (e !== y.get.placeholderText() && H.removeClass(T.placeholder),
                                y.debug("Changing text", e, H),
                                H.removeClass(T.filtered),
                                A.preserveHTML ? H.html(e) : H.text(e)))
                        },
                        selectedItem: function(e) {
                            var t = y.get.choiceValue(e)
                                , n = y.get.choiceText(e, !1);
                            y.debug("Setting user selection to item", e),
                                y.remove.activeItem(),
                                y.set.partialSearch(n),
                                y.set.activeItem(e),
                                y.set.selected(t, e),
                                y.set.text(n)
                        },
                        selectedLetter: function(t) {
                            var n, i = $.filter("." + T.selected), a = i.length > 0 && y.has.firstLetter(i, t), o = !1;
                            a && (n = i.nextAll($).eq(0),
                                y.has.firstLetter(n, t) && (o = n)),
                                o || $.each(function() {
                                if (y.has.firstLetter(e(this), t))
                                    return o = e(this),
                                        !1
                            }),
                                o && (y.verbose("Scrolling to next value with letter", t),
                                y.set.scrollPosition(o),
                                i.removeClass(T.selected),
                                o.addClass(T.selected),
                                A.selectOnKeydown && y.is.single() && y.set.selectedItem(o))
                        },
                        direction: function(e) {
                            "auto" == A.direction ? y.is.onScreen(e) ? y.remove.upward(e) : y.set.upward(e) : "upward" == A.direction && y.set.upward(e)
                        },
                        upward: function(e) {
                            var t = e || z;
                            t.addClass(T.upward)
                        },
                        value: function(e, t, n) {
                            var a = y.escape.value(e)
                                , o = N.length > 0
                                , s = (!y.has.value(e),
                                    y.get.values())
                                , r = e !== i ? String(e) : e;
                            if (o) {
                                if (!A.allowReselection && r == s && (y.verbose("Skipping value update already same value", e, s),
                                    !y.is.initialLoad()))
                                    return;
                                y.is.single() && y.has.selectInput() && y.can.extendSelect() && (y.debug("Adding user option", e),
                                    y.add.optionValue(e)),
                                    y.debug("Updating input value", a, s),
                                    G = !0,
                                    N.val(a),
                                        A.fireOnInit === !1 && y.is.initialLoad() ? y.debug("Input native change event ignored on initial load") : y.trigger.change(),
                                    G = !1
                            } else
                                y.verbose("Storing value in metadata", a, N),
                                    a !== s && z.data(D.value, r);
                            A.fireOnInit === !1 && y.is.initialLoad() ? y.verbose("No callback on initial load", A.onChange) : A.onChange.call(J, e, t, n)
                        },
                        active: function() {
                            z.addClass(T.active)
                        },
                        multiple: function() {
                            z.addClass(T.multiple)
                        },
                        visible: function() {
                            z.addClass(T.visible)
                        },
                        exactly: function(e, t) {
                            y.debug("Setting selected to exact values"),
                                y.clear(),
                                y.set.selected(e, t)
                        },
                        selected: function(t, n) {
                            var i = y.is.multiple();
                            n = A.allowAdditions ? n || y.get.itemWithAdditions(t) : n || y.get.item(t),
                                n && (y.debug("Setting selected menu item to", n),
                                y.is.multiple() && y.remove.searchWidth(),
                                y.is.single() ? (y.remove.activeItem(),
                                    y.remove.selectedItem()) : A.useLabels && y.remove.selectedItem(),
                                n.each(function() {
                                    var t = e(this)
                                        , a = y.get.choiceText(t)
                                        , o = y.get.choiceValue(t, a)
                                        , s = t.hasClass(T.filtered)
                                        , r = t.hasClass(T.active)
                                        , l = t.hasClass(T.addition)
                                        , c = i && 1 == n.length;
                                    i ? !r || l ? (A.apiSettings && A.saveRemoteData && y.save.remoteData(a, o),
                                        A.useLabels ? (y.add.value(o, a, t),
                                            y.add.label(o, a, c),
                                            y.set.activeItem(t),
                                            y.filterActive(),
                                            y.select.nextAvailable(n)) : (y.add.value(o, a, t),
                                            y.set.text(y.add.variables(k.count)),
                                            y.set.activeItem(t))) : s || (y.debug("Selected active value, removing label"),
                                        y.remove.selected(o)) : (A.apiSettings && A.saveRemoteData && y.save.remoteData(a, o),
                                        y.set.text(a),
                                        y.set.value(o, a, t),
                                        t.addClass(T.active).addClass(T.selected))
                                }))
                        }
                    },
                    add: {
                        label: function(t, n, i) {
                            var a, o = y.is.searchSelection() ? j : H, s = y.escape.value(t);
                            return a = e("<a />").addClass(T.label).attr("data-value", s).html(E.label(s, n)),
                                a = A.onLabelCreate.call(a, s, n),
                                y.has.label(t) ? void y.debug("Label already exists, skipping", s) : (A.label.variation && a.addClass(A.label.variation),
                                    void (i === !0 ? (y.debug("Animating in label", a),
                                        a.addClass(T.hidden).insertBefore(o).transition(A.label.transition, A.label.duration)) : (y.debug("Adding selection label", a),
                                        a.insertBefore(o))))
                        },
                        message: function(t) {
                            var n = W.children(O.message)
                                , i = A.templates.message(y.add.variables(t));
                            n.length > 0 ? n.html(i) : n = e("<div/>").html(i).addClass(T.message).appendTo(W)
                        },
                        optionValue: function(t) {
                            var n = y.escape.value(t)
                                , i = N.find('option[value="' + n + '"]')
                                , a = i.length > 0;
                            a || (y.disconnect.selectObserver(),
                                y.is.single() && (y.verbose("Removing previous user addition"),
                                N.find("option." + T.addition).remove()),
                                e("<option/>").prop("value", n).addClass(T.addition).html(t).appendTo(N),
                                y.verbose("Adding user addition as an <option>", t),
                                y.observe.select())
                        },
                        userSuggestion: function(e) {
                            var t, n = W.children(O.addition), i = y.get.item(e), a = i && i.not(O.addition).length, o = n.length > 0;
                            if (!A.useLabels || !y.has.maxSelections()) {
                                if ("" === e || a)
                                    return void n.remove();
                                o ? (n.data(D.value, e).data(D.text, e).attr("data-" + D.value, e).attr("data-" + D.text, e).removeClass(T.filtered),
                                    A.hideAdditions || (t = A.templates.addition(y.add.variables(k.addResult, e)),
                                    n.html(t)),
                                    y.verbose("Replacing user suggestion with new value", n)) : (n = y.create.userChoice(e),
                                    n.prependTo(W),
                                    y.verbose("Adding item choice to menu corresponding with user choice addition", n)),
                                    A.hideAdditions && !y.is.allFiltered() || n.addClass(T.selected).siblings().removeClass(T.selected),
                                    y.refreshItems()
                            }
                        },
                        variables: function(e, t) {
                            var n, i, a = e.search("{count}") !== -1, o = e.search("{maxCount}") !== -1, s = e.search("{term}") !== -1;
                            return y.verbose("Adding templated variables to message", e),
                                a && (n = y.get.selectionCount(),
                                e = e.replace("{count}", n)),
                                o && (n = y.get.selectionCount(),
                                e = e.replace("{maxCount}", A.maxSelections)),
                                s && (i = t || y.get.query(),
                                e = e.replace("{term}", i)),
                                e
                        },
                        value: function(t, n, i) {
                            var a, o = y.get.values();
                            return "" === t ? void y.debug("Cannot select blank values from multiselect") : (e.isArray(o) ? (a = o.concat([t]),
                                a = y.get.uniqueArray(a)) : a = [t],
                                y.has.selectInput() ? y.can.extendSelect() && (y.debug("Adding value to select", t, a, N),
                                    y.add.optionValue(t)) : (a = a.join(A.delimiter),
                                    y.debug("Setting hidden input to delimited value", a, N)),
                                    A.fireOnInit === !1 && y.is.initialLoad() ? y.verbose("Skipping onadd callback on initial load", A.onAdd) : A.onAdd.call(J, t, n, i),
                                y.set.value(a, t, n, i),
                                void y.check.maxSelections())
                        }
                    },
                    remove: {
                        active: function() {
                            z.removeClass(T.active)
                        },
                        activeLabel: function() {
                            z.find(O.label).removeClass(T.active)
                        },
                        empty: function() {
                            z.removeClass(T.empty)
                        },
                        loading: function() {
                            z.removeClass(T.loading)
                        },
                        initialLoad: function() {
                            g = !1
                        },
                        upward: function(e) {
                            var t = e || z;
                            t.removeClass(T.upward)
                        },
                        visible: function() {
                            z.removeClass(T.visible)
                        },
                        activeItem: function() {
                            $.removeClass(T.active)
                        },
                        filteredItem: function() {
                            A.useLabels && y.has.maxSelections() || (A.useLabels && y.is.multiple() ? $.not("." + T.active).removeClass(T.filtered) : $.removeClass(T.filtered),
                                y.remove.empty())
                        },
                        optionValue: function(e) {
                            var t = y.escape.value(e)
                                , n = N.find('option[value="' + t + '"]')
                                , i = n.length > 0;
                            i && n.hasClass(T.addition) && (C && (C.disconnect(),
                                y.verbose("Temporarily disconnecting mutation observer")),
                                n.remove(),
                                y.verbose("Removing user addition as an <option>", t),
                                C && C.observe(N[0], {
                                childList: !0,
                                subtree: !0
                            }))
                        },
                        message: function() {
                            W.children(O.message).remove()
                        },
                        searchWidth: function() {
                            j.css("width", "")
                        },
                        searchTerm: function() {
                            y.verbose("Cleared search term"),
                                j.val(""),
                                y.set.filtered()
                        },
                        userAddition: function() {
                            $.filter(O.addition).remove()
                        },
                        selected: function(t, n) {
                            return !!(n = A.allowAdditions ? n || y.get.itemWithAdditions(t) : n || y.get.item(t)) && void n.each(function() {
                                var t = e(this)
                                    , n = y.get.choiceText(t)
                                    , i = y.get.choiceValue(t, n);
                                y.is.multiple() ? A.useLabels ? (y.remove.value(i, n, t),
                                    y.remove.label(i)) : (y.remove.value(i, n, t),
                                        0 === y.get.selectionCount() ? y.set.placeholderText() : y.set.text(y.add.variables(k.count))) : y.remove.value(i, n, t),
                                    t.removeClass(T.filtered).removeClass(T.active),
                                    A.useLabels && t.removeClass(T.selected)
                            })
                        },
                        selectedItem: function() {
                            $.removeClass(T.selected)
                        },
                        value: function(e, t, n) {
                            var i, a = y.get.values();
                            y.has.selectInput() ? (y.verbose("Input is <select> removing selected option", e),
                                i = y.remove.arrayValue(e, a),
                                y.remove.optionValue(e)) : (y.verbose("Removing from delimited values", e),
                                i = y.remove.arrayValue(e, a),
                                i = i.join(A.delimiter)),
                                    A.fireOnInit === !1 && y.is.initialLoad() ? y.verbose("No callback on initial load", A.onRemove) : A.onRemove.call(J, e, t, n),
                                y.set.value(i, t, n),
                                y.check.maxSelections()
                        },
                        arrayValue: function(t, n) {
                            return e.isArray(n) || (n = [n]),
                                n = e.grep(n, function(e) {
                                    return t != e
                                }),
                                y.verbose("Removed value from delimited string", t, n),
                                n
                        },
                        label: function(e, t) {
                            var n = z.find(O.label)
                                , i = n.filter('[data-value="' + e + '"]');
                            y.verbose("Removing label", i),
                                i.remove()
                        },
                        activeLabels: function(e) {
                            e = e || z.find(O.label).filter("." + T.active),
                                y.verbose("Removing active label selections", e),
                                y.remove.labels(e)
                        },
                        labels: function(t) {
                            t = t || z.find(O.label),
                                y.verbose("Removing labels", t),
                                t.each(function() {
                                    var t = e(this)
                                        , n = t.data(D.value)
                                        , a = n !== i ? String(n) : n
                                        , o = y.is.userValue(a);
                                    return A.onLabelRemove.call(t, n) === !1 ? void y.debug("Label remove callback cancelled removal") : (y.remove.message(),
                                        void (o ? (y.remove.value(a),
                                            y.remove.label(a)) : y.remove.selected(a)))
                                })
                        },
                        tabbable: function() {
                            y.has.search() ? (y.debug("Searchable dropdown initialized"),
                                j.removeAttr("tabindex"),
                                W.removeAttr("tabindex")) : (y.debug("Simple selection dropdown initialized"),
                                z.removeAttr("tabindex"),
                                W.removeAttr("tabindex"))
                        }
                    },
                    has: {
                        menuSearch: function() {
                            return y.has.search() && j.closest(W).length > 0
                        },
                        search: function() {
                            return j.length > 0
                        },
                        sizer: function() {
                            return U.length > 0
                        },
                        selectInput: function() {
                            return N.is("select")
                        },
                        minCharacters: function(e) {
                            return !A.minCharacters || (e = e !== i ? String(e) : String(y.get.query()),
                                e.length >= A.minCharacters)
                        },
                        firstLetter: function(e, t) {
                            var n, i;
                            return !(!e || 0 === e.length || "string" != typeof t) && (n = y.get.choiceText(e, !1),
                                t = t.toLowerCase(),
                                i = String(n).charAt(0).toLowerCase(),
                                t == i)
                        },
                        input: function() {
                            return N.length > 0
                        },
                        items: function() {
                            return $.length > 0
                        },
                        menu: function() {
                            return W.length > 0
                        },
                        message: function() {
                            return 0 !== W.children(O.message).length
                        },
                        label: function(e) {
                            var t = y.escape.value(e)
                                , n = z.find(O.label);
                            return n.filter('[data-value="' + t + '"]').length > 0
                        },
                        maxSelections: function() {
                            return A.maxSelections && y.get.selectionCount() >= A.maxSelections
                        },
                        allResultsFiltered: function() {
                            var e = $.not(O.addition);
                            return e.filter(O.unselectable).length === e.length
                        },
                        userSuggestion: function() {
                            return W.children(O.addition).length > 0
                        },
                        query: function() {
                            return "" !== y.get.query()
                        },
                        value: function(t) {
                            var n = y.get.values()
                                , i = e.isArray(n) ? n && e.inArray(t, n) !== -1 : n == t;
                            return !!i
                        }
                    },
                    is: {
                        active: function() {
                            return z.hasClass(T.active)
                        },
                        bubbledLabelClick: function(t) {
                            return e(t.target).is("select, input") && z.closest("label").length > 0
                        },
                        bubbledIconClick: function(t) {
                            return e(t.target).closest(K).length > 0
                        },
                        alreadySetup: function() {
                            return z.is("select") && z.parent(O.dropdown).length > 0 && 0 === z.prev().length
                        },
                        animating: function(e) {
                            return e ? e.transition && e.transition("is animating") : W.transition && W.transition("is animating")
                        },
                        disabled: function() {
                            return z.hasClass(T.disabled)
                        },
                        focused: function() {
                            return n.activeElement === z[0]
                        },
                        focusedOnSearch: function() {
                            return n.activeElement === j[0]
                        },
                        allFiltered: function() {
                            return (y.is.multiple() || y.has.search()) && !(0 == A.hideAdditions && y.has.userSuggestion()) && !y.has.message() && y.has.allResultsFiltered()
                        },
                        hidden: function(e) {
                            return !y.is.visible(e)
                        },
                        initialLoad: function() {
                            return g
                        },
                        onScreen: function(e) {
                            var t, n = e || W, i = !0, a = {};
                            return n.addClass(T.loading),
                                t = {
                                    context: {
                                        scrollTop: P.scrollTop(),
                                        height: P.outerHeight()
                                    },
                                    menu: {
                                        offset: n.offset(),
                                        height: n.outerHeight()
                                    }
                                },
                                a = {
                                    above: t.context.scrollTop <= t.menu.offset.top - t.menu.height,
                                    below: t.context.scrollTop + t.context.height >= t.menu.offset.top + t.menu.height
                                },
                                a.below ? (y.verbose("Dropdown can fit in context downward", a),
                                    i = !0) : a.below || a.above ? (y.verbose("Dropdown cannot fit below, opening upward", a),
                                    i = !1) : (y.verbose("Dropdown cannot fit in either direction, favoring downward", a),
                                    i = !0),
                                n.removeClass(T.loading),
                                i
                        },
                        inObject: function(t, n) {
                            var i = !1;
                            return e.each(n, function(e, n) {
                                if (n == t)
                                    return i = !0,
                                        !0
                            }),
                                i
                        },
                        multiple: function() {
                            return z.hasClass(T.multiple)
                        },
                        single: function() {
                            return !y.is.multiple()
                        },
                        selectMutation: function(t) {
                            var n = !1;
                            return e.each(t, function(t, i) {
                                if (i.target && e(i.target).is("select"))
                                    return n = !0,
                                        !0
                            }),
                                n
                        },
                        search: function() {
                            return z.hasClass(T.search)
                        },
                        searchSelection: function() {
                            return y.has.search() && 1 === j.parent(O.dropdown).length
                        },
                        selection: function() {
                            return z.hasClass(T.selection)
                        },
                        userValue: function(t) {
                            return e.inArray(t, y.get.userValues()) !== -1
                        },
                        upward: function(e) {
                            var t = e || z;
                            return t.hasClass(T.upward)
                        },
                        visible: function(e) {
                            return e ? e.hasClass(T.visible) : W.hasClass(T.visible)
                        }
                    },
                    can: {
                        activate: function(e) {
                            return !!A.useLabels || (!y.has.maxSelections() || !(!y.has.maxSelections() || !e.hasClass(T.active)))
                        },
                        click: function() {
                            return c || "click" == A.on
                        },
                        extendSelect: function() {
                            return A.allowAdditions || A.apiSettings
                        },
                        show: function() {
                            return !y.is.disabled() && (y.has.items() || y.has.message())
                        },
                        useAPI: function() {
                            return e.fn.api !== i
                        }
                    },
                    animate: {
                        show: function(t, n) {
                            var a, o = n || W, s = n ? function() {}
                                    : function() {
                                    y.hideSubMenus(),
                                        y.hideOthers(),
                                        y.set.active()
                                }
                                ;
                            t = e.isFunction(t) ? t : function() {}
                                ,
                                y.verbose("Doing menu show animation", o),
                                y.set.direction(n),
                                a = y.get.transition(n),
                                y.is.selection() && y.set.scrollPosition(y.get.selectedItem(), !0),
                                (y.is.hidden(o) || y.is.animating(o)) && ("none" == a ? (s(),
                                o.transition("show"),
                                t.call(J)) : e.fn.transition !== i && z.transition("is supported") ? o.transition({
                                animation: a + " in",
                                debug: A.debug,
                                verbose: A.verbose,
                                duration: A.duration,
                                queue: !0,
                                onStart: s,
                                onComplete: function() {
                                    t.call(J)
                                }
                            }) : y.error(V.noTransition, a))
                        },
                        hide: function(t, n) {
                            var a = n || W
                                , o = (n ? .9 * A.duration : A.duration,
                                    n ? function() {}
                                        : function() {
                                        y.can.click() && y.unbind.intent(),
                                            y.remove.active()
                                    }
                                    )
                                , s = y.get.transition(n);
                            t = e.isFunction(t) ? t : function() {}
                                ,
                                (y.is.visible(a) || y.is.animating(a)) && (y.verbose("Doing menu hide animation", a),
                                    "none" == s ? (o(),
                                a.transition("hide"),
                                t.call(J)) : e.fn.transition !== i && z.transition("is supported") ? a.transition({
                                animation: s + " out",
                                duration: A.duration,
                                debug: A.debug,
                                verbose: A.verbose,
                                queue: !0,
                                onStart: o,
                                onComplete: function() {
                                    "auto" == A.direction && y.remove.upward(n),
                                        t.call(J)
                                }
                            }) : y.error(V.transition))
                        }
                    },
                    hideAndClear: function() {
                        y.remove.searchTerm(),
                            y.has.maxSelections() || (y.has.search() ? y.hide(function() {
                            y.remove.filteredItem()
                        }) : y.hide())
                    },
                    delay: {
                        show: function() {
                            y.verbose("Delaying show event to ensure user intent"),
                                clearTimeout(y.timer),
                                y.timer = setTimeout(y.show, A.delay.show)
                        },
                        hide: function() {
                            y.verbose("Delaying hide event to ensure user intent"),
                                clearTimeout(y.timer),
                                y.timer = setTimeout(y.hide, A.delay.hide)
                        }
                    },
                    escape: {
                        value: function(t) {
                            var n = e.isArray(t)
                                , i = "string" == typeof t
                                , a = !i && !n
                                , o = i && t.search(R.quote) !== -1
                                , s = [];
                            return y.has.selectInput() && !a && o ? (y.debug("Encoding quote values for use in select", t),
                                n ? (e.each(t, function(e, t) {
                                    s.push(t.replace(R.quote, "&quot;"))
                                }),
                                    s) : t.replace(R.quote, "&quot;")) : t
                        },
                        regExp: function(e) {
                            return e = String(e),
                                e.replace(R.escape, "\\$&")
                        }
                    },
                    setting: function(t, n) {
                        if (y.debug("Changing setting", t, n),
                            e.isPlainObject(t))
                            e.extend(!0, A, t);
                        else {
                            if (n === i)
                                return A[t];
                            e.isPlainObject(A[t]) ? e.extend(!0, A[t], n) : A[t] = n
                        }
                    },
                    internal: function(t, n) {
                        if (e.isPlainObject(t))
                            e.extend(!0, y, t);
                        else {
                            if (n === i)
                                return y[t];
                            y[t] = n
                        }
                    },
                    debug: function() {
                        !A.silent && A.debug && (A.performance ? y.performance.log(arguments) : (y.debug = Function.prototype.bind.call(console.info, console, A.name + ":"),
                            y.debug.apply(console, arguments)))
                    },
                    verbose: function() {
                        !A.silent && A.verbose && A.debug && (A.performance ? y.performance.log(arguments) : (y.verbose = Function.prototype.bind.call(console.info, console, A.name + ":"),
                            y.verbose.apply(console, arguments)))
                    },
                    error: function() {
                        A.silent || (y.error = Function.prototype.bind.call(console.error, console, A.name + ":"),
                            y.error.apply(console, arguments))
                    },
                    performance: {
                        log: function(e) {
                            var t, n, i;
                            A.performance && (t = (new Date).getTime(),
                                i = u || t,
                                n = t - i,
                                u = t,
                                d.push({
                                    Name: e[0],
                                    Arguments: [].slice.call(e, 1) || "",
                                    Element: J,
                                    "Execution Time": n
                                })),
                                clearTimeout(y.performance.timer),
                                y.performance.timer = setTimeout(y.performance.display, 500)
                        },
                        display: function() {
                            var t = A.name + ":"
                                , n = 0;
                            u = !1,
                                clearTimeout(y.performance.timer),
                                e.each(d, function(e, t) {
                                    n += t["Execution Time"]
                                }),
                                t += " " + n + "ms",
                                l && (t += " '" + l + "'"),
                                (console.group !== i || console.table !== i) && d.length > 0 && (console.groupCollapsed(t),
                                console.table ? console.table(d) : e.each(d, function(e, t) {
                                    console.log(t.Name + ": " + t["Execution Time"] + "ms")
                                }),
                                console.groupEnd()),
                                d = []
                        }
                    },
                    invoke: function(t, n, a) {
                        var s, r, l, c = X;
                        return n = n || f,
                            a = J || a,
                            "string" == typeof t && c !== i && (t = t.split(/[\. ]/),
                            s = t.length - 1,
                            e.each(t, function(n, a) {
                                var o = n != s ? a + t[n + 1].charAt(0).toUpperCase() + t[n + 1].slice(1) : t;
                                if (e.isPlainObject(c[o]) && n != s)
                                    c = c[o];
                                else {
                                    if (c[o] !== i)
                                        return r = c[o],
                                            !1;
                                    if (!e.isPlainObject(c[a]) || n == s)
                                        return c[a] !== i ? (r = c[a],
                                            !1) : (y.error(V.method, t),
                                            !1);
                                    c = c[a]
                                }
                            })),
                            e.isFunction(r) ? l = r.apply(a, n) : r !== i && (l = r),
                            e.isArray(o) ? o.push(l) : o !== i ? o = [o, l] : l !== i && (o = l),
                            r
                    }
                },
                    m ? (X === i && y.initialize(),
                        y.invoke(v)) : (X !== i && X.invoke("destroy"),
                        y.initialize())
            }),
                    o !== i ? o : s
        }
        ,
        e.fn.dropdown.settings = {
            silent: !1,
            debug: !1,
            verbose: !1,
            performance: !0,
            on: "click",
            action: "activate",
            apiSettings: !1,
            selectOnKeydown: !0,
            minCharacters: 0,
            saveRemoteData: !0,
            throttle: 200,
            context: t,
            direction: "auto",
            keepOnScreen: !0,
            match: "both",
            fullTextSearch: !1,
            placeholder: "auto",
            preserveHTML: !0,
            sortSelect: !1,
            forceSelection: !0,
            allowAdditions: !1,
            hideAdditions: !0,
            maxSelections: !1,
            useLabels: !0,
            delimiter: ",",
            showOnFocus: !0,
            allowReselection: !1,
            allowTab: !0,
            allowCategorySelection: !1,
            fireOnInit: !1,
            transition: "auto",
            duration: 200,
            glyphWidth: 1.037,
            label: {
                transition: "scale",
                duration: 200,
                variation: !1
            },
            delay: {
                hide: 300,
                show: 200,
                search: 20,
                touch: 50
            },
            onChange: function(e, t, n) {},
            onAdd: function(e, t, n) {},
            onRemove: function(e, t, n) {},
            onLabelSelect: function(e) {},
            onLabelCreate: function(t, n) {
                return e(this)
            },
            onLabelRemove: function(e) {
                return !0
            },
            onNoResults: function(e) {
                return !0
            },
            onShow: function() {},
            onHide: function() {},
            name: "Dropdown",
            namespace: "dropdown",
            message: {
                addResult: "Add <b>{term}</b>",
                count: "{count} selected",
                maxSelections: "Max {maxCount} selections",
                noResults: "No results found.",
                serverError: "There was an error contacting the server"
            },
            error: {
                action: "You called a dropdown action that was not defined",
                alreadySetup: "Once a select has been initialized behaviors must be called on the created ui dropdown",
                labels: "Allowing user additions currently requires the use of labels.",
                missingMultiple: "<select> requires multiple property to be set to correctly preserve multiple values",
                method: "The method you called is not defined.",
                noAPI: "The API module is required to load resources remotely",
                noStorage: "Saving remote data requires session storage",
                noTransition: "This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>"
            },
            regExp: {
                escape: /[-[\]{}()*+?.,\\^$|#\s]/g,
                quote: /"/g
            },
            metadata: {
                defaultText: "defaultText",
                defaultValue: "defaultValue",
                placeholderText: "placeholder",
                text: "text",
                value: "value"
            },
            fields: {
                remoteValues: "results",
                values: "values",
                disabled: "disabled",
                name: "name",
                value: "value",
                text: "text"
            },
            keys: {
                backspace: 8,
                delimiter: 188,
                deleteKey: 46,
                enter: 13,
                escape: 27,
                pageUp: 33,
                pageDown: 34,
                leftArrow: 37,
                upArrow: 38,
                rightArrow: 39,
                downArrow: 40
            },
            selector: {
                addition: ".addition",
                dropdown: ".ui.dropdown",
                hidden: ".hidden",
                icon: "> .dropdown.icon",
                input: '> input[type="hidden"], > select',
                item: ".item",
                label: "> .label",
                remove: "> .label > .delete.icon",
                siblingLabel: ".label",
                menu: ".menu",
                message: ".message",
                menuIcon: ".dropdown.icon",
                search: "input.search, .menu > .search > input, .menu input.search",
                sizer: "> input.sizer",
                text: "> .text:not(.icon)",
                unselectable: ".disabled, .filtered"
            },
            className: {
                active: "active",
                addition: "addition",
                animating: "animating",
                disabled: "disabled",
                empty: "empty",
                dropdown: "ui dropdown",
                filtered: "filtered",
                hidden: "hidden transition",
                item: "item",
                label: "ui label",
                loading: "loading",
                menu: "menu",
                message: "message",
                multiple: "multiple",
                placeholder: "default",
                sizer: "sizer",
                search: "search",
                selected: "selected",
                selection: "selection",
                upward: "upward",
                visible: "visible"
            }
        },
        e.fn.dropdown.settings.templates = {
            dropdown: function(t) {
                var n = t.placeholder || !1
                    , i = (t.values || {},
                        "");
                return i += '<i class="dropdown icon"></i>',
                    i += t.placeholder ? '<div class="default text">' + n + "</div>" : '<div class="text"></div>',
                    i += '<div class="menu">',
                    e.each(t.values, function(e, t) {
                        i += t.disabled ? '<div class="disabled item" data-value="' + t.value + '">' + t.name + "</div>" : '<div class="item" data-value="' + t.value + '">' + t.name + "</div>"
                    }),
                    i += "</div>"
            },
            menu: function(t, n) {
                var i = t[n.values] || {}
                    , a = "";
                return e.each(i, function(e, t) {
                    var i = t[n.text] ? 'data-text="' + t[n.text] + '"' : ""
                        , o = t[n.disabled] ? "disabled " : "";
                    a += '<div class="' + o + 'item" data-value="' + t[n.value] + '"' + i + ">",
                        a += t[n.name],
                        a += "</div>"
                }),
                    a
            },
            label: function(e, t) {
                return t + '<i class="delete icon"></i>'
            },
            message: function(e) {
                return e
            },
            addition: function(e) {
                return e
            }
        }
}(jQuery, window, document);
!function(e, i, n, t) {
    "use strict";
    i = "undefined" != typeof i && i.Math == Math ? i : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(),
        e.fn.dimmer = function(i) {
            var o, a = e(this), r = (new Date).getTime(), s = [], m = arguments[0], d = "string" == typeof m, c = [].slice.call(arguments, 1);
            return a.each(function() {
                var u, l, f, g = e.isPlainObject(i) ? e.extend(!0, {}, e.fn.dimmer.settings, i) : e.extend({}, e.fn.dimmer.settings), p = g.selector, h = g.namespace, b = g.className, v = g.error, y = "." + h, C = "module-" + h, w = a.selector || "", S = "ontouchstart"in n.documentElement ? "touchstart" : "click", D = e(this), T = this, N = D.data(C);
                f = {
                    preinitialize: function() {
                        f.is.dimmer() ? (l = D.parent(),
                            u = D) : (l = D,
                            u = f.has.dimmer() ? g.dimmerName ? l.find(p.dimmer).filter("." + g.dimmerName) : l.find(p.dimmer) : f.create(),
                            f.set.variation())
                    },
                    initialize: function() {
                        f.debug("Initializing dimmer", g),
                            f.bind.events(),
                            f.set.dimmable(),
                            f.instantiate()
                    },
                    instantiate: function() {
                        f.verbose("Storing instance of module", f),
                            N = f,
                            D.data(C, N)
                    },
                    destroy: function() {
                        f.verbose("Destroying previous module", u),
                            f.unbind.events(),
                            f.remove.variation(),
                            l.off(y)
                    },
                    bind: {
                        events: function() {
                            "hover" == g.on ? l.on("mouseenter" + y, f.show).on("mouseleave" + y, f.hide) : "click" == g.on && l.on(S + y, f.toggle),
                                f.is.page() && (f.debug("Setting as a page dimmer", l),
                                f.set.pageDimmer()),
                                f.is.closable() && (f.verbose("Adding dimmer close event", u),
                                l.on(S + y, p.dimmer, f.event.click))
                        }
                    },
                    unbind: {
                        events: function() {
                            D.removeData(C),
                                l.off(y)
                        }
                    },
                    event: {
                        click: function(i) {
                            f.verbose("Determining if event occured on dimmer", i),
                                (0 === u.find(i.target).length || e(i.target).is(p.content)) && (f.hide(),
                                i.stopImmediatePropagation())
                        }
                    },
                    addContent: function(i) {
                        var n = e(i);
                        f.debug("Add content to dimmer", n),
                            n.parent()[0] !== u[0] && n.detach().appendTo(u)
                    },
                    create: function() {
                        var i = e(g.template.dimmer());
                        return g.dimmerName && (f.debug("Creating named dimmer", g.dimmerName),
                            i.addClass(g.dimmerName)),
                            i.appendTo(l),
                            i
                    },
                    show: function(i) {
                        i = e.isFunction(i) ? i : function() {}
                            ,
                            f.debug("Showing dimmer", u, g),
                                f.is.dimmed() && !f.is.animating() || !f.is.enabled() ? f.debug("Dimmer is already shown or disabled") : (f.animate.show(i),
                            g.onShow.call(T),
                            g.onChange.call(T))
                    },
                    hide: function(i) {
                        i = e.isFunction(i) ? i : function() {}
                            ,
                                f.is.dimmed() || f.is.animating() ? (f.debug("Hiding dimmer", u),
                            f.animate.hide(i),
                            g.onHide.call(T),
                            g.onChange.call(T)) : f.debug("Dimmer is not visible")
                    },
                    toggle: function() {
                        f.verbose("Toggling dimmer visibility", u),
                            f.is.dimmed() ? f.hide() : f.show()
                    },
                    animate: {
                        show: function(i) {
                            i = e.isFunction(i) ? i : function() {}
                                ,
                                    g.useCSS && e.fn.transition !== t && u.transition("is supported") ? ("auto" !== g.opacity && f.set.opacity(),
                                u.transition({
                                    animation: g.transition + " in",
                                    queue: !1,
                                    duration: f.get.duration(),
                                    useFailSafe: !0,
                                    onStart: function() {
                                        f.set.dimmed()
                                    },
                                    onComplete: function() {
                                        f.set.active(),
                                            i()
                                    }
                                })) : (f.verbose("Showing dimmer animation with javascript"),
                                f.set.dimmed(),
                                "auto" == g.opacity && (g.opacity = .8),
                                u.stop().css({
                                    opacity: 0,
                                    width: "100%",
                                    height: "100%"
                                }).fadeTo(f.get.duration(), g.opacity, function() {
                                    u.removeAttr("style"),
                                        f.set.active(),
                                        i()
                                }))
                        },
                        hide: function(i) {
                            i = e.isFunction(i) ? i : function() {}
                                ,
                                    g.useCSS && e.fn.transition !== t && u.transition("is supported") ? (f.verbose("Hiding dimmer with css"),
                                u.transition({
                                    animation: g.transition + " out",
                                    queue: !1,
                                    duration: f.get.duration(),
                                    useFailSafe: !0,
                                    onStart: function() {
                                        f.remove.dimmed()
                                    },
                                    onComplete: function() {
                                        f.remove.active(),
                                            i()
                                    }
                                })) : (f.verbose("Hiding dimmer with javascript"),
                                f.remove.dimmed(),
                                u.stop().fadeOut(f.get.duration(), function() {
                                    f.remove.active(),
                                        u.removeAttr("style"),
                                        i()
                                }))
                        }
                    },
                    get: {
                        dimmer: function() {
                            return u
                        },
                        duration: function() {
                            return "object" == typeof g.duration ? f.is.active() ? g.duration.hide : g.duration.show : g.duration
                        }
                    },
                    has: {
                        dimmer: function() {
                            return g.dimmerName ? D.find(p.dimmer).filter("." + g.dimmerName).length > 0 : D.find(p.dimmer).length > 0
                        }
                    },
                    is: {
                        active: function() {
                            return u.hasClass(b.active)
                        },
                        animating: function() {
                            return u.is(":animated") || u.hasClass(b.animating)
                        },
                        closable: function() {
                            return "auto" == g.closable ? "hover" != g.on : g.closable
                        },
                        dimmer: function() {
                            return D.hasClass(b.dimmer)
                        },
                        dimmable: function() {
                            return D.hasClass(b.dimmable)
                        },
                        dimmed: function() {
                            return l.hasClass(b.dimmed)
                        },
                        disabled: function() {
                            return l.hasClass(b.disabled)
                        },
                        enabled: function() {
                            return !f.is.disabled()
                        },
                        page: function() {
                            return l.is("body")
                        },
                        pageDimmer: function() {
                            return u.hasClass(b.pageDimmer)
                        }
                    },
                    can: {
                        show: function() {
                            return !u.hasClass(b.disabled)
                        }
                    },
                    set: {
                        opacity: function(e) {
                            var i = u.css("background-color")
                                , n = i.split(",")
                                , t = n && 3 == n.length
                                , o = n && 4 == n.length;
                            e = 0 === g.opacity ? 0 : g.opacity || e,
                                    t || o ? (n[3] = e + ")",
                                i = n.join(",")) : i = "rgba(0, 0, 0, " + e + ")",
                                f.debug("Setting opacity to", e),
                                u.css("background-color", i)
                        },
                        active: function() {
                            u.addClass(b.active)
                        },
                        dimmable: function() {
                            l.addClass(b.dimmable)
                        },
                        dimmed: function() {
                            l.addClass(b.dimmed)
                        },
                        pageDimmer: function() {
                            u.addClass(b.pageDimmer)
                        },
                        disabled: function() {
                            u.addClass(b.disabled)
                        },
                        variation: function(e) {
                            e = e || g.variation,
                                e && u.addClass(e)
                        }
                    },
                    remove: {
                        active: function() {
                            u.removeClass(b.active)
                        },
                        dimmed: function() {
                            l.removeClass(b.dimmed)
                        },
                        disabled: function() {
                            u.removeClass(b.disabled)
                        },
                        variation: function(e) {
                            e = e || g.variation,
                                e && u.removeClass(e)
                        }
                    },
                    setting: function(i, n) {
                        if (f.debug("Changing setting", i, n),
                            e.isPlainObject(i))
                            e.extend(!0, g, i);
                        else {
                            if (n === t)
                                return g[i];
                            e.isPlainObject(g[i]) ? e.extend(!0, g[i], n) : g[i] = n
                        }
                    },
                    internal: function(i, n) {
                        if (e.isPlainObject(i))
                            e.extend(!0, f, i);
                        else {
                            if (n === t)
                                return f[i];
                            f[i] = n
                        }
                    },
                    debug: function() {
                        !g.silent && g.debug && (g.performance ? f.performance.log(arguments) : (f.debug = Function.prototype.bind.call(console.info, console, g.name + ":"),
                            f.debug.apply(console, arguments)))
                    },
                    verbose: function() {
                        !g.silent && g.verbose && g.debug && (g.performance ? f.performance.log(arguments) : (f.verbose = Function.prototype.bind.call(console.info, console, g.name + ":"),
                            f.verbose.apply(console, arguments)))
                    },
                    error: function() {
                        g.silent || (f.error = Function.prototype.bind.call(console.error, console, g.name + ":"),
                            f.error.apply(console, arguments))
                    },
                    performance: {
                        log: function(e) {
                            var i, n, t;
                            g.performance && (i = (new Date).getTime(),
                                t = r || i,
                                n = i - t,
                                r = i,
                                s.push({
                                    Name: e[0],
                                    Arguments: [].slice.call(e, 1) || "",
                                    Element: T,
                                    "Execution Time": n
                                })),
                                clearTimeout(f.performance.timer),
                                f.performance.timer = setTimeout(f.performance.display, 500)
                        },
                        display: function() {
                            var i = g.name + ":"
                                , n = 0;
                            r = !1,
                                clearTimeout(f.performance.timer),
                                e.each(s, function(e, i) {
                                    n += i["Execution Time"]
                                }),
                                i += " " + n + "ms",
                                w && (i += " '" + w + "'"),
                                a.length > 1 && (i += " (" + a.length + ")"),
                                (console.group !== t || console.table !== t) && s.length > 0 && (console.groupCollapsed(i),
                                console.table ? console.table(s) : e.each(s, function(e, i) {
                                    console.log(i.Name + ": " + i["Execution Time"] + "ms")
                                }),
                                console.groupEnd()),
                                s = []
                        }
                    },
                    invoke: function(i, n, a) {
                        var r, s, m, d = N;
                        return n = n || c,
                            a = T || a,
                            "string" == typeof i && d !== t && (i = i.split(/[\. ]/),
                            r = i.length - 1,
                            e.each(i, function(n, o) {
                                var a = n != r ? o + i[n + 1].charAt(0).toUpperCase() + i[n + 1].slice(1) : i;
                                if (e.isPlainObject(d[a]) && n != r)
                                    d = d[a];
                                else {
                                    if (d[a] !== t)
                                        return s = d[a],
                                            !1;
                                    if (!e.isPlainObject(d[o]) || n == r)
                                        return d[o] !== t ? (s = d[o],
                                            !1) : (f.error(v.method, i),
                                            !1);
                                    d = d[o]
                                }
                            })),
                            e.isFunction(s) ? m = s.apply(a, n) : s !== t && (m = s),
                            e.isArray(o) ? o.push(m) : o !== t ? o = [o, m] : m !== t && (o = m),
                            s
                    }
                },
                    f.preinitialize(),
                    d ? (N === t && f.initialize(),
                        f.invoke(m)) : (N !== t && N.invoke("destroy"),
                        f.initialize())
            }),
                    o !== t ? o : this
        }
        ,
        e.fn.dimmer.settings = {
            name: "Dimmer",
            namespace: "dimmer",
            silent: !1,
            debug: !1,
            verbose: !1,
            performance: !0,
            dimmerName: !1,
            variation: !1,
            closable: "auto",
            useCSS: !0,
            transition: "fade",
            on: !1,
            opacity: "auto",
            duration: {
                show: 500,
                hide: 500
            },
            onChange: function() {},
            onShow: function() {},
            onHide: function() {},
            error: {
                method: "The method you called is not defined."
            },
            className: {
                active: "active",
                animating: "animating",
                dimmable: "dimmable",
                dimmed: "dimmed",
                dimmer: "dimmer",
                disabled: "disabled",
                hide: "hide",
                pageDimmer: "page",
                show: "show"
            },
            selector: {
                dimmer: "> .ui.dimmer",
                content: ".ui.dimmer > .content, .ui.dimmer > .content > .center"
            },
            template: {
                dimmer: function() {
                    return e("<div />").attr("class", "ui dimmer")
                }
            }
        }
}(jQuery, window, document);
!function(e, t, n, r) {
    "use strict";
    t = "undefined" != typeof t && t.Math == Math ? t : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(),
        e.fn.form = function(t) {
            var i, a = e(this), o = a.selector || "", l = (new Date).getTime(), s = [], u = arguments[0], c = arguments[1], f = "string" == typeof u, d = [].slice.call(arguments, 1);
            return a.each(function() {
                var p, m, g, h, v, b, y, x, k, E, w, C, V, R, S, F, A, T, j = e(this), D = this, O = [], z = !1;
                T = {
                    initialize: function() {
                        T.get.settings(),
                            f ? (A === r && T.instantiate(),
                                T.invoke(u)) : (A !== r && A.invoke("destroy"),
                                T.verbose("Initializing form validation", j, x),
                                T.bindEvents(),
                                T.set.defaults(),
                                T.instantiate())
                    },
                    instantiate: function() {
                        T.verbose("Storing instance of module", T),
                            A = T,
                            j.data(S, T)
                    },
                    destroy: function() {
                        T.verbose("Destroying previous module", A),
                            T.removeEvents(),
                            j.removeData(S)
                    },
                    refresh: function() {
                        T.verbose("Refreshing selector cache"),
                            p = j.find(w.field),
                            m = j.find(w.group),
                            g = j.find(w.message),
                            h = j.find(w.prompt),
                            v = j.find(w.submit),
                            b = j.find(w.clear),
                            y = j.find(w.reset)
                    },
                    submit: function() {
                        T.verbose("Submitting form", j),
                            j.submit()
                    },
                    attachEvents: function(t, n) {
                        n = n || "submit",
                            e(t).on("click" + F, function(e) {
                                T[n](),
                                    e.preventDefault()
                            })
                    },
                    bindEvents: function() {
                        T.verbose("Attaching form events"),
                            j.on("submit" + F, T.validate.form).on("blur" + F, w.field, T.event.field.blur).on("click" + F, w.submit, T.submit).on("click" + F, w.reset, T.reset).on("click" + F, w.clear, T.clear),
                            x.keyboardShortcuts && j.on("keydown" + F, w.field, T.event.field.keydown),
                            p.each(function() {
                                var t = e(this)
                                    , n = t.prop("type")
                                    , r = T.get.changeEvent(n, t);
                                e(this).on(r + F, T.event.field.change)
                            })
                    },
                    clear: function() {
                        p.each(function() {
                            var t = e(this)
                                , n = t.parent()
                                , r = t.closest(m)
                                , i = r.find(w.prompt)
                                , a = t.data(E.defaultValue) || ""
                                , o = n.is(w.uiCheckbox)
                                , l = n.is(w.uiDropdown)
                                , s = r.hasClass(C.error);
                            s && (T.verbose("Resetting error on field", r),
                                r.removeClass(C.error),
                                i.remove()),
                                l ? (T.verbose("Resetting dropdown value", n, a),
                                    n.dropdown("clear")) : o ? t.prop("checked", !1) : (T.verbose("Resetting field value", t, a),
                                    t.val(""))
                        })
                    },
                    reset: function() {
                        p.each(function() {
                            var t = e(this)
                                , n = t.parent()
                                , i = t.closest(m)
                                , a = i.find(w.prompt)
                                , o = t.data(E.defaultValue)
                                , l = n.is(w.uiCheckbox)
                                , s = n.is(w.uiDropdown)
                                , u = i.hasClass(C.error);
                            o !== r && (u && (T.verbose("Resetting error on field", i),
                                i.removeClass(C.error),
                                a.remove()),
                                s ? (T.verbose("Resetting dropdown value", n, o),
                                    n.dropdown("restore defaults")) : l ? (T.verbose("Resetting checkbox value", n, o),
                                    t.prop("checked", o)) : (T.verbose("Resetting field value", t, o),
                                    t.val(o)))
                        })
                    },
                    is: {
                        bracketedRule: function(e) {
                            return e.type && e.type.match(x.regExp.bracket)
                        },
                        empty: function(e) {
                            return !e || 0 === e.length || (e.is('input[type="checkbox"]') ? !e.is(":checked") : T.is.blank(e))
                        },
                        blank: function(t) {
                            return "" === e.trim(t.val())
                        },
                        valid: function() {
                            var t = !0;
                            return T.verbose("Checking if form is valid"),
                                e.each(k, function(e, n) {
                                    T.validate.field(n, e) || (t = !1)
                                }),
                                t
                        }
                    },
                    removeEvents: function() {
                        j.off(F),
                            p.off(F),
                            v.off(F),
                            p.off(F)
                    },
                    event: {
                        field: {
                            keydown: function(t) {
                                var n = e(this)
                                    , r = t.which
                                    , i = n.is(w.input)
                                    , a = n.is(w.checkbox)
                                    , o = n.closest(w.uiDropdown).length > 0
                                    , l = {
                                        enter: 13,
                                        escape: 27
                                    };
                                r == l.escape && (T.verbose("Escape key pressed blurring field"),
                                    n.blur()),
                                    t.ctrlKey || r != l.enter || !i || o || a || (z || (n.one("keyup" + F, T.event.field.keyup),
                                    T.submit(),
                                    T.debug("Enter pressed on input submitting form")),
                                    z = !0)
                            },
                            keyup: function() {
                                z = !1
                            },
                            blur: function(t) {
                                var n = e(this)
                                    , r = n.closest(m)
                                    , i = T.get.validation(n);
                                r.hasClass(C.error) ? (T.debug("Revalidating field", n, i),
                                    i && T.validate.field(i)) : "blur" != x.on && "change" != x.on || i && T.validate.field(i)
                            },
                            change: function(t) {
                                var n = e(this)
                                    , r = n.closest(m)
                                    , i = T.get.validation(n);
                                ("change" == x.on || r.hasClass(C.error) && x.revalidate) && (clearTimeout(T.timer),
                                    T.timer = setTimeout(function() {
                                        T.debug("Revalidating field", n, T.get.validation(n)),
                                            T.validate.field(i)
                                    }, x.delay))
                            }
                        }
                    },
                    get: {
                        ancillaryValue: function(e) {
                            return !(!e.type || !e.value && !T.is.bracketedRule(e)) && (e.value !== r ? e.value : e.type.match(x.regExp.bracket)[1] + "")
                        },
                        ruleName: function(e) {
                            return T.is.bracketedRule(e) ? e.type.replace(e.type.match(x.regExp.bracket)[0], "") : e.type
                        },
                        changeEvent: function(e, t) {
                            return "checkbox" == e || "radio" == e || "hidden" == e || t.is("select") ? "change" : T.get.inputEvent()
                        },
                        inputEvent: function() {
                            return n.createElement("input").oninput !== r ? "input" : n.createElement("input").onpropertychange !== r ? "propertychange" : "keyup"
                        },
                        prompt: function(e, t) {
                            var n, r, i, a = T.get.ruleName(e), o = T.get.ancillaryValue(e), l = e.prompt || x.prompt[a] || x.text.unspecifiedRule, s = l.search("{value}") !== -1, u = l.search("{name}") !== -1;
                            return (u || s) && (r = T.get.field(t.identifier)),
                                s && (l = l.replace("{value}", r.val())),
                                u && (n = r.closest(w.group).find("label").eq(0),
                                i = 1 == n.length ? n.text() : r.prop("placeholder") || x.text.unspecifiedField,
                                l = l.replace("{name}", i)),
                                l = l.replace("{identifier}", t.identifier),
                                l = l.replace("{ruleValue}", o),
                                e.prompt || T.verbose("Using default validation prompt for type", l, a),
                                l
                        },
                        settings: function() {
                            if (e.isPlainObject(t)) {
                                var n, i = Object.keys(t), a = i.length > 0 && (t[i[0]].identifier !== r && t[i[0]].rules !== r);
                                a ? (x = e.extend(!0, {}, e.fn.form.settings, c),
                                    k = e.extend({}, e.fn.form.settings.defaults, t),
                                    T.error(x.error.oldSyntax, D),
                                    T.verbose("Extending settings from legacy parameters", k, x)) : (t.fields && (n = Object.keys(t.fields),
                                    ("string" == typeof t.fields[n[0]] || e.isArray(t.fields[n[0]])) && e.each(t.fields, function(n, r) {
                                    "string" == typeof r && (r = [r]),
                                        t.fields[n] = {
                                            rules: []
                                        },
                                        e.each(r, function(e, r) {
                                            t.fields[n].rules.push({
                                                type: r
                                            })
                                        })
                                })),
                                    x = e.extend(!0, {}, e.fn.form.settings, t),
                                    k = e.extend({}, e.fn.form.settings.defaults, x.fields),
                                    T.verbose("Extending settings", k, x))
                            } else
                                x = e.fn.form.settings,
                                    k = e.fn.form.settings.defaults,
                                    T.verbose("Using default form validation", k, x);
                            R = x.namespace,
                                E = x.metadata,
                                w = x.selector,
                                C = x.className,
                                V = x.error,
                                S = "module-" + R,
                                F = "." + R,
                                A = j.data(S),
                                T.refresh()
                        },
                        field: function(t) {
                            return T.verbose("Finding field with identifier", t),
                                    p.filter("#" + t).length > 0 ? p.filter("#" + t) : p.filter('[name="' + t + '"]').length > 0 ? p.filter('[name="' + t + '"]') : p.filter('[name="' + t + '[]"]').length > 0 ? p.filter('[name="' + t + '[]"]') : p.filter("[data-" + E.validate + '="' + t + '"]').length > 0 ? p.filter("[data-" + E.validate + '="' + t + '"]') : e("<input/>")
                        },
                        fields: function(t) {
                            var n = e();
                            return e.each(t, function(e, t) {
                                n = n.add(T.get.field(t))
                            }),
                                n
                        },
                        validation: function(t) {
                            var n, r;
                            return !!k && (e.each(k, function(e, i) {
                                r = i.identifier || e,
                                    T.get.field(r)[0] == t[0] && (i.identifier = r,
                                    n = i)
                            }),
                                n || !1)
                        },
                        value: function(e) {
                            var t, n = [];
                            return n.push(e),
                                t = T.get.values.call(D, n),
                                t[e]
                        },
                        values: function(t) {
                            var n = e.isArray(t) ? T.get.fields(t) : p
                                , r = {};
                            return n.each(function(t, n) {
                                var i = e(n)
                                    , a = (i.prop("type"),
                                        i.prop("name"))
                                    , o = i.val()
                                    , l = i.is(w.checkbox)
                                    , s = i.is(w.radio)
                                    , u = a.indexOf("[]") !== -1
                                    , c = !!l && i.is(":checked");
                                a && (u ? (a = a.replace("[]", ""),
                                    r[a] || (r[a] = []),
                                    l ? c ? r[a].push(o || !0) : r[a].push(!1) : r[a].push(o)) : s ? c && (r[a] = o) : l ? c ? r[a] = o || !0 : r[a] = !1 : r[a] = o)
                            }),
                                r
                        }
                    },
                    has: {
                        field: function(e) {
                            return T.verbose("Checking for existence of a field with identifier", e),
                                "string" != typeof e && T.error(V.identifier, e),
                                p.filter("#" + e).length > 0 || (p.filter('[name="' + e + '"]').length > 0 || p.filter("[data-" + E.validate + '="' + e + '"]').length > 0)
                        }
                    },
                    add: {
                        prompt: function(t, n) {
                            var i = T.get.field(t)
                                , a = i.closest(m)
                                , o = a.children(w.prompt)
                                , l = 0 !== o.length;
                            n = "string" == typeof n ? [n] : n,
                                T.verbose("Adding field error state", t),
                                a.addClass(C.error),
                                x.inline && (l || (o = x.templates.prompt(n),
                                o.appendTo(a)),
                                o.html(n[0]),
                                l ? T.verbose("Inline errors are disabled, no inline error added", t) : x.transition && e.fn.transition !== r && j.transition("is supported") ? (T.verbose("Displaying error with css transition", x.transition),
                                    o.transition(x.transition + " in", x.duration)) : (T.verbose("Displaying error with fallback javascript animation"),
                                    o.fadeIn(x.duration)))
                        },
                        errors: function(e) {
                            T.debug("Adding form error messages", e),
                                T.set.error(),
                                g.html(x.templates.error(e))
                        }
                    },
                    remove: {
                        prompt: function(t) {
                            var n = T.get.field(t)
                                , i = n.closest(m)
                                , a = i.children(w.prompt);
                            i.removeClass(C.error),
                                x.inline && a.is(":visible") && (T.verbose("Removing prompt for field", t),
                                    x.transition && e.fn.transition !== r && j.transition("is supported") ? a.transition(x.transition + " out", x.duration, function() {
                                a.remove()
                            }) : a.fadeOut(x.duration, function() {
                                a.remove()
                            }))
                        }
                    },
                    set: {
                        success: function() {
                            j.removeClass(C.error).addClass(C.success)
                        },
                        defaults: function() {
                            p.each(function() {
                                var t = e(this)
                                    , n = t.filter(w.checkbox).length > 0
                                    , r = n ? t.is(":checked") : t.val();
                                t.data(E.defaultValue, r)
                            })
                        },
                        error: function() {
                            j.removeClass(C.success).addClass(C.error)
                        },
                        value: function(e, t) {
                            var n = {};
                            return n[e] = t,
                                T.set.values.call(D, n)
                        },
                        values: function(t) {
                            e.isEmptyObject(t) || e.each(t, function(t, n) {
                                var r, i = T.get.field(t), a = i.parent(), o = e.isArray(n), l = a.is(w.uiCheckbox), s = a.is(w.uiDropdown), u = i.is(w.radio) && l, c = i.length > 0;
                                c && (o && l ? (T.verbose("Selecting multiple", n, i),
                                    a.checkbox("uncheck"),
                                    e.each(n, function(e, t) {
                                        r = i.filter('[value="' + t + '"]'),
                                            a = r.parent(),
                                            r.length > 0 && a.checkbox("check")
                                    })) : u ? (T.verbose("Selecting radio value", n, i),
                                    i.filter('[value="' + n + '"]').parent(w.uiCheckbox).checkbox("check")) : l ? (T.verbose("Setting checkbox value", n, a),
                                        n === !0 ? a.checkbox("check") : a.checkbox("uncheck")) : s ? (T.verbose("Setting dropdown value", n, a),
                                    a.dropdown("set selected", n)) : (T.verbose("Setting field value", n, i),
                                    i.val(n)))
                            })
                        }
                    },
                    validate: {
                        form: function(e, t) {
                            var n = T.get.values();
                            if (z)
                                return !1;
                            if (O = [],
                                T.is.valid()) {
                                if (T.debug("Form has no validation errors, submitting"),
                                    T.set.success(),
                                    t !== !0)
                                    return x.onSuccess.call(D, e, n)
                            } else if (T.debug("Form has errors"),
                                T.set.error(),
                                x.inline || T.add.errors(O),
                                j.data("moduleApi") !== r && e.stopImmediatePropagation(),
                                t !== !0)
                                return x.onFailure.call(D, O, n)
                        },
                        field: function(t, n) {
                            var i = t.identifier || n
                                , a = T.get.field(i)
                                , o = !!t.depends && T.get.field(t.depends)
                                , l = !0
                                , s = [];
                            return t.identifier || (T.debug("Using field name as identifier", i),
                                t.identifier = i),
                                a.prop("disabled") ? (T.debug("Field is disabled. Skipping", i),
                                    l = !0) : t.optional && T.is.blank(a) ? (T.debug("Field is optional and blank. Skipping", i),
                                    l = !0) : t.depends && T.is.empty(o) ? (T.debug("Field depends on another value that is not present or empty. Skipping", o),
                                    l = !0) : t.rules !== r && e.each(t.rules, function(e, n) {
                                    T.has.field(i) && !T.validate.rule(t, n) && (T.debug("Field is invalid", i, n.type),
                                        s.push(T.get.prompt(n, t)),
                                        l = !1)
                                }),
                                l ? (T.remove.prompt(i, s),
                                    x.onValid.call(a),
                                    !0) : (O = O.concat(s),
                                    T.add.prompt(i, s),
                                    x.onInvalid.call(a, s),
                                    !1)
                        },
                        rule: function(t, n) {
                            var i = T.get.field(t.identifier)
                                , a = (n.type,
                                    i.val())
                                , o = T.get.ancillaryValue(n)
                                , l = T.get.ruleName(n)
                                , s = x.rules[l];
                            return e.isFunction(s) ? (a = a === r || "" === a || null === a ? "" : e.trim(a + ""),
                                s.call(i, a, o)) : void T.error(V.noRule, l)
                        }
                    },
                    setting: function(t, n) {
                        if (e.isPlainObject(t))
                            e.extend(!0, x, t);
                        else {
                            if (n === r)
                                return x[t];
                            x[t] = n
                        }
                    },
                    internal: function(t, n) {
                        if (e.isPlainObject(t))
                            e.extend(!0, T, t);
                        else {
                            if (n === r)
                                return T[t];
                            T[t] = n
                        }
                    },
                    debug: function() {
                        !x.silent && x.debug && (x.performance ? T.performance.log(arguments) : (T.debug = Function.prototype.bind.call(console.info, console, x.name + ":"),
                            T.debug.apply(console, arguments)))
                    },
                    verbose: function() {
                        !x.silent && x.verbose && x.debug && (x.performance ? T.performance.log(arguments) : (T.verbose = Function.prototype.bind.call(console.info, console, x.name + ":"),
                            T.verbose.apply(console, arguments)))
                    },
                    error: function() {
                        x.silent || (T.error = Function.prototype.bind.call(console.error, console, x.name + ":"),
                            T.error.apply(console, arguments))
                    },
                    performance: {
                        log: function(e) {
                            var t, n, r;
                            x.performance && (t = (new Date).getTime(),
                                r = l || t,
                                n = t - r,
                                l = t,
                                s.push({
                                    Name: e[0],
                                    Arguments: [].slice.call(e, 1) || "",
                                    Element: D,
                                    "Execution Time": n
                                })),
                                clearTimeout(T.performance.timer),
                                T.performance.timer = setTimeout(T.performance.display, 500)
                        },
                        display: function() {
                            var t = x.name + ":"
                                , n = 0;
                            l = !1,
                                clearTimeout(T.performance.timer),
                                e.each(s, function(e, t) {
                                    n += t["Execution Time"]
                                }),
                                t += " " + n + "ms",
                                o && (t += " '" + o + "'"),
                                a.length > 1 && (t += " (" + a.length + ")"),
                                (console.group !== r || console.table !== r) && s.length > 0 && (console.groupCollapsed(t),
                                console.table ? console.table(s) : e.each(s, function(e, t) {
                                    console.log(t.Name + ": " + t["Execution Time"] + "ms")
                                }),
                                console.groupEnd()),
                                s = []
                        }
                    },
                    invoke: function(t, n, a) {
                        var o, l, s, u = A;
                        return n = n || d,
                            a = D || a,
                            "string" == typeof t && u !== r && (t = t.split(/[\. ]/),
                            o = t.length - 1,
                            e.each(t, function(n, i) {
                                var a = n != o ? i + t[n + 1].charAt(0).toUpperCase() + t[n + 1].slice(1) : t;
                                if (e.isPlainObject(u[a]) && n != o)
                                    u = u[a];
                                else {
                                    if (u[a] !== r)
                                        return l = u[a],
                                            !1;
                                    if (!e.isPlainObject(u[i]) || n == o)
                                        return u[i] !== r && (l = u[i],
                                            !1);
                                    u = u[i]
                                }
                            })),
                            e.isFunction(l) ? s = l.apply(a, n) : l !== r && (s = l),
                            e.isArray(i) ? i.push(s) : i !== r ? i = [i, s] : s !== r && (i = s),
                            l
                    }
                },
                    T.initialize()
            }),
                    i !== r ? i : this
        }
        ,
        e.fn.form.settings = {
            name: "Form",
            namespace: "form",
            debug: !1,
            verbose: !1,
            performance: !0,
            fields: !1,
            keyboardShortcuts: !0,
            on: "submit",
            inline: !1,
            delay: 200,
            revalidate: !0,
            transition: "scale",
            duration: 200,
            onValid: function() {},
            onInvalid: function() {},
            onSuccess: function() {
                return !0
            },
            onFailure: function() {
                return !1
            },
            metadata: {
                defaultValue: "default",
                validate: "validate"
            },
            regExp: {
                bracket: /\[(.*)\]/i,
                decimal: /^\d*(\.)\d+/,
                email: /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,
                escape: /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
                flags: /^\/(.*)\/(.*)?/,
                integer: /^\-?\d+$/,
                number: /^\-?\d*(\.\d+)?$/,
                url: /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/i
            },
            text: {
                unspecifiedRule: "Please enter a valid value",
                unspecifiedField: "This field"
            },
            prompt: {
                empty: "{name} must have a value",
                checked: "{name} must be checked",
                email: "{name} must be a valid e-mail",
                url: "{name} must be a valid url",
                regExp: "{name} is not formatted correctly",
                integer: "{name} must be an integer",
                decimal: "{name} must be a decimal number",
                number: "{name} must be set to a number",
                is: '{name} must be "{ruleValue}"',
                isExactly: '{name} must be exactly "{ruleValue}"',
                not: '{name} cannot be set to "{ruleValue}"',
                notExactly: '{name} cannot be set to exactly "{ruleValue}"',
                contain: '{name} cannot contain "{ruleValue}"',
                containExactly: '{name} cannot contain exactly "{ruleValue}"',
                doesntContain: '{name} must contain  "{ruleValue}"',
                doesntContainExactly: '{name} must contain exactly "{ruleValue}"',
                minLength: "{name} must be at least {ruleValue} characters",
                length: "{name} must be at least {ruleValue} characters",
                exactLength: "{name} must be exactly {ruleValue} characters",
                maxLength: "{name} cannot be longer than {ruleValue} characters",
                match: "{name} must match {ruleValue} field",
                different: "{name} must have a different value than {ruleValue} field",
                creditCard: "{name} must be a valid credit card number",
                minCount: "{name} must have at least {ruleValue} choices",
                exactCount: "{name} must have exactly {ruleValue} choices",
                maxCount: "{name} must have {ruleValue} or less choices"
            },
            selector: {
                checkbox: 'input[type="checkbox"], input[type="radio"]',
                clear: ".clear",
                field: "input, textarea, select",
                group: ".field",
                input: "input",
                message: ".error.message",
                prompt: ".prompt.label",
                radio: 'input[type="radio"]',
                reset: '.reset:not([type="reset"])',
                submit: '.submit:not([type="submit"])',
                uiCheckbox: ".ui.checkbox",
                uiDropdown: ".ui.dropdown"
            },
            className: {
                error: "error",
                label: "ui prompt label",
                pressed: "down",
                success: "success"
            },
            error: {
                identifier: "You must specify a string identifier for each field",
                method: "The method you called is not defined.",
                noRule: "There is no rule matching the one you specified",
                oldSyntax: "Starting in 2.0 forms now only take a single settings object. Validation settings converted to new syntax automatically."
            },
            templates: {
                error: function(t) {
                    var n = '<ul class="list">';
                    return e.each(t, function(e, t) {
                        n += "<li>" + t + "</li>"
                    }),
                        n += "</ul>",
                        e(n)
                },
                prompt: function(t) {
                    return e("<div/>").addClass("ui basic red pointing prompt label").html(t[0])
                }
            },
            rules: {
                empty: function(t) {
                    return !(t === r || "" === t || e.isArray(t) && 0 === t.length)
                },
                checked: function() {
                    return e(this).filter(":checked").length > 0
                },
                email: function(t) {
                    return e.fn.form.settings.regExp.email.test(t)
                },
                url: function(t) {
                    return e.fn.form.settings.regExp.url.test(t)
                },
                regExp: function(t, n) {
                    if (n instanceof RegExp)
                        return t.match(n);
                    var r, i = n.match(e.fn.form.settings.regExp.flags);
                    return i && (n = i.length >= 2 ? i[1] : n,
                        r = i.length >= 3 ? i[2] : ""),
                        t.match(new RegExp(n,r))
                },
                integer: function(t, n) {
                    var i, a, o, l = e.fn.form.settings.regExp.integer;
                    return n && ["", ".."].indexOf(n) === -1 && (n.indexOf("..") == -1 ? l.test(n) && (i = a = n - 0) : (o = n.split("..", 2),
                        l.test(o[0]) && (i = o[0] - 0),
                        l.test(o[1]) && (a = o[1] - 0))),
                        l.test(t) && (i === r || t >= i) && (a === r || t <= a)
                },
                decimal: function(t) {
                    return e.fn.form.settings.regExp.decimal.test(t)
                },
                number: function(t) {
                    return e.fn.form.settings.regExp.number.test(t)
                },
                is: function(e, t) {
                    return t = "string" == typeof t ? t.toLowerCase() : t,
                        e = "string" == typeof e ? e.toLowerCase() : e,
                        e == t
                },
                isExactly: function(e, t) {
                    return e == t
                },
                not: function(e, t) {
                    return e = "string" == typeof e ? e.toLowerCase() : e,
                        t = "string" == typeof t ? t.toLowerCase() : t,
                        e != t
                },
                notExactly: function(e, t) {
                    return e != t
                },
                contains: function(t, n) {
                    return n = n.replace(e.fn.form.settings.regExp.escape, "\\$&"),
                        t.search(new RegExp(n,"i")) !== -1
                },
                containsExactly: function(t, n) {
                    return n = n.replace(e.fn.form.settings.regExp.escape, "\\$&"),
                        t.search(new RegExp(n)) !== -1
                },
                doesntContain: function(t, n) {
                    return n = n.replace(e.fn.form.settings.regExp.escape, "\\$&"),
                        t.search(new RegExp(n,"i")) === -1
                },
                doesntContainExactly: function(t, n) {
                    return n = n.replace(e.fn.form.settings.regExp.escape, "\\$&"),
                        t.search(new RegExp(n)) === -1
                },
                minLength: function(e, t) {
                    return e !== r && e.length >= t
                },
                length: function(e, t) {
                    return e !== r && e.length >= t
                },
                exactLength: function(e, t) {
                    return e !== r && e.length == t
                },
                maxLength: function(e, t) {
                    return e !== r && e.length <= t
                },
                match: function(t, n) {
                    var i;
                    e(this);
                    return e('[data-validate="' + n + '"]').length > 0 ? i = e('[data-validate="' + n + '"]').val() : e("#" + n).length > 0 ? i = e("#" + n).val() : e('[name="' + n + '"]').length > 0 ? i = e('[name="' + n + '"]').val() : e('[name="' + n + '[]"]').length > 0 && (i = e('[name="' + n + '[]"]')),
                        i !== r && t.toString() == i.toString()
                },
                different: function(t, n) {
                    var i;
                    e(this);
                    return e('[data-validate="' + n + '"]').length > 0 ? i = e('[data-validate="' + n + '"]').val() : e("#" + n).length > 0 ? i = e("#" + n).val() : e('[name="' + n + '"]').length > 0 ? i = e('[name="' + n + '"]').val() : e('[name="' + n + '[]"]').length > 0 && (i = e('[name="' + n + '[]"]')),
                        i !== r && t.toString() !== i.toString()
                },
                creditCard: function(t, n) {
                    var r, i, a = {
                        visa: {
                            pattern: /^4/,
                            length: [16]
                        },
                        amex: {
                            pattern: /^3[47]/,
                            length: [15]
                        },
                        mastercard: {
                            pattern: /^5[1-5]/,
                            length: [16]
                        },
                        discover: {
                            pattern: /^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,
                            length: [16]
                        },
                        unionPay: {
                            pattern: /^(62|88)/,
                            length: [16, 17, 18, 19]
                        },
                        jcb: {
                            pattern: /^35(2[89]|[3-8][0-9])/,
                            length: [16]
                        },
                        maestro: {
                            pattern: /^(5018|5020|5038|6304|6759|676[1-3])/,
                            length: [12, 13, 14, 15, 16, 17, 18, 19]
                        },
                        dinersClub: {
                            pattern: /^(30[0-5]|^36)/,
                            length: [14]
                        },
                        laser: {
                            pattern: /^(6304|670[69]|6771)/,
                            length: [16, 17, 18, 19]
                        },
                        visaElectron: {
                            pattern: /^(4026|417500|4508|4844|491(3|7))/,
                            length: [16]
                        }
                    }, o = {}, l = !1, s = "string" == typeof n && n.split(",");
                    if ("string" == typeof t && 0 !== t.length) {
                        if (s && (e.each(s, function(n, r) {
                            i = a[r],
                                i && (o = {
                                length: e.inArray(t.length, i.length) !== -1,
                                pattern: t.search(i.pattern) !== -1
                            },
                                o.length && o.pattern && (l = !0))
                        }),
                            !l))
                            return !1;
                        if (r = {
                            number: e.inArray(t.length, a.unionPay.length) !== -1,
                            pattern: t.search(a.unionPay.pattern) !== -1
                        },
                            r.number && r.pattern)
                            return !0;
                        for (var u = t.length, c = 0, f = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 2, 4, 6, 8, 1, 3, 5, 7, 9]], d = 0; u--; )
                            d += f[c][parseInt(t.charAt(u), 10)],
                                c ^= 1;
                        return d % 10 === 0 && d > 0
                    }
                },
                minCount: function(e, t) {
                    return 0 == t || (1 == t ? "" !== e : e.split(",").length >= t)
                },
                exactCount: function(e, t) {
                    return 0 == t ? "" === e : 1 == t ? "" !== e && e.search(",") === -1 : e.split(",").length == t
                },
                maxCount: function(e, t) {
                    return 0 != t && (1 == t ? e.search(",") === -1 : e.split(",").length <= t)
                }
            }
        }
}(jQuery, window, document);
!function(t, e, o, n) {
    "use strict";
    e = "undefined" != typeof e && e.Math == Math ? e : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(),
        t.fn.popup = function(i) {
            var r, a = t(this), s = t(o), p = t(e), l = t("body"), u = a.selector || "", c = !0, d = (new Date).getTime(), f = [], g = arguments[0], h = "string" == typeof g, m = [].slice.call(arguments, 1);
            return a.each(function() {
                var a, v, b, w, y, C, T = t.isPlainObject(i) ? t.extend(!0, {}, t.fn.popup.settings, i) : t.extend({}, t.fn.popup.settings), P = T.selector, x = T.className, k = T.error, S = T.metadata, E = T.namespace, A = "." + T.namespace, D = "module-" + E, O = t(this), j = t(T.context), F = t(T.scrollContext), R = t(T.boundary), H = T.target ? t(T.target) : O, N = 0, M = !1, W = !1, G = this, I = O.data(D);
                C = {
                    initialize: function() {
                        C.debug("Initializing", O),
                            C.createID(),
                            C.bind.events(),
                            !C.exists() && T.preserve && C.create(),
                            T.observeChanges && C.observeChanges(),
                            C.instantiate()
                    },
                    instantiate: function() {
                        C.verbose("Storing instance", C),
                            I = C,
                            O.data(D, I)
                    },
                    observeChanges: function() {
                        "MutationObserver"in e && (b = new MutationObserver(C.event.documentChanged),
                            b.observe(o, {
                                childList: !0,
                                subtree: !0
                            }),
                            C.debug("Setting up mutation observer", b))
                    },
                    refresh: function() {
                        T.popup ? a = t(T.popup).eq(0) : T.inline && (a = H.nextAll(P.popup).eq(0),
                            T.popup = a),
                            T.popup ? (a.addClass(x.loading),
                                v = C.get.offsetParent(),
                                a.removeClass(x.loading),
                                T.movePopup && C.has.popup() && C.get.offsetParent(a)[0] !== v[0] && (C.debug("Moving popup to the same offset parent as activating element"),
                                a.detach().appendTo(v))) : v = T.inline ? C.get.offsetParent(H) : C.has.popup() ? C.get.offsetParent(a) : l,
                            v.is("html") && v[0] !== l[0] && (C.debug("Setting page as offset parent"),
                            v = l),
                            C.get.variation() && C.set.variation()
                    },
                    reposition: function() {
                        C.refresh(),
                            C.set.position()
                    },
                    destroy: function() {
                        C.debug("Destroying previous module"),
                            b && b.disconnect(),
                            a && !T.preserve && C.removePopup(),
                            clearTimeout(C.hideTimer),
                            clearTimeout(C.showTimer),
                            C.unbind.close(),
                            C.unbind.events(),
                            O.removeData(D)
                    },
                    event: {
                        start: function(e) {
                            var o = t.isPlainObject(T.delay) ? T.delay.show : T.delay;
                            clearTimeout(C.hideTimer),
                                W || (C.showTimer = setTimeout(C.show, o))
                        },
                        end: function() {
                            var e = t.isPlainObject(T.delay) ? T.delay.hide : T.delay;
                            clearTimeout(C.showTimer),
                                C.hideTimer = setTimeout(C.hide, e)
                        },
                        touchstart: function(t) {
                            W = !0,
                                C.show()
                        },
                        resize: function() {
                            C.is.visible() && C.set.position()
                        },
                        documentChanged: function(e) {
                            [].forEach.call(e, function(e) {
                                e.removedNodes && [].forEach.call(e.removedNodes, function(e) {
                                    (e == G || t(e).find(G).length > 0) && (C.debug("Element removed from DOM, tearing down events"),
                                        C.destroy())
                                })
                            })
                        },
                        hideGracefully: function(e) {
                            var n = t(e.target)
                                , i = t.contains(o.documentElement, e.target)
                                , r = n.closest(P.popup).length > 0;
                            e && !r && i ? (C.debug("Click occurred outside popup hiding popup"),
                                C.hide()) : C.debug("Click was inside popup, keeping popup open")
                        }
                    },
                    create: function() {
                        var e = C.get.html()
                            , o = C.get.title()
                            , n = C.get.content();
                        e || n || o ? (C.debug("Creating pop-up html"),
                            e || (e = T.templates.popup({
                            title: o,
                            content: n
                        })),
                            a = t("<div/>").addClass(x.popup).data(S.activator, O).html(e),
                            T.inline ? (C.verbose("Inserting popup element inline", a),
                                a.insertAfter(O)) : (C.verbose("Appending popup element to body", a),
                                a.appendTo(j)),
                            C.refresh(),
                            C.set.variation(),
                            T.hoverable && C.bind.popup(),
                            T.onCreate.call(a, G)) : 0 !== H.next(P.popup).length ? (C.verbose("Pre-existing popup found"),
                            T.inline = !0,
                            T.popup = H.next(P.popup).data(S.activator, O),
                            C.refresh(),
                            T.hoverable && C.bind.popup()) : T.popup ? (t(T.popup).data(S.activator, O),
                            C.verbose("Used popup specified in settings"),
                            C.refresh(),
                            T.hoverable && C.bind.popup()) : C.debug("No content specified skipping display", G)
                    },
                    createID: function() {
                        y = (Math.random().toString(16) + "000000000").substr(2, 8),
                            w = "." + y,
                            C.verbose("Creating unique id for element", y)
                    },
                    toggle: function() {
                        C.debug("Toggling pop-up"),
                            C.is.hidden() ? (C.debug("Popup is hidden, showing pop-up"),
                                C.unbind.close(),
                                C.show()) : (C.debug("Popup is visible, hiding pop-up"),
                                C.hide())
                    },
                    show: function(t) {
                        if (t = t || function() {}
                            ,
                            C.debug("Showing pop-up", T.transition),
                            C.is.hidden() && (!C.is.active() || !C.is.dropdown())) {
                            if (C.exists() || C.create(),
                                T.onShow.call(a, G) === !1)
                                return void C.debug("onShow callback returned false, cancelling popup animation");
                            T.preserve || T.popup || C.refresh(),
                                a && C.set.position() && (C.save.conditions(),
                                T.exclusive && C.hideAll(),
                                C.animate.show(t))
                        }
                    },
                    hide: function(t) {
                        if (t = t || function() {}
                            ,
                            C.is.visible() || C.is.animating()) {
                            if (T.onHide.call(a, G) === !1)
                                return void C.debug("onHide callback returned false, cancelling popup animation");
                            C.remove.visible(),
                                C.unbind.close(),
                                C.restore.conditions(),
                                C.animate.hide(t)
                        }
                    },
                    hideAll: function() {
                        t(P.popup).filter("." + x.visible).each(function() {
                            t(this).data(S.activator).popup("hide")
                        })
                    },
                    exists: function() {
                        return !!a && (T.inline || T.popup ? C.has.popup() : a.closest(j).length >= 1)
                    },
                    removePopup: function() {
                        C.has.popup() && !T.popup && (C.debug("Removing popup", a),
                            a.remove(),
                            a = n,
                            T.onRemove.call(a, G))
                    },
                    save: {
                        conditions: function() {
                            C.cache = {
                                title: O.attr("title")
                            },
                                C.cache.title && O.removeAttr("title"),
                                C.verbose("Saving original attributes", C.cache.title)
                        }
                    },
                    restore: {
                        conditions: function() {
                            return C.cache && C.cache.title && (O.attr("title", C.cache.title),
                                C.verbose("Restoring original attributes", C.cache.title)),
                                !0
                        }
                    },
                    supports: {
                        svg: function() {
                            return typeof SVGGraphicsElement === n
                        }
                    },
                    animate: {
                        show: function(e) {
                            e = t.isFunction(e) ? e : function() {}
                                ,
                                    T.transition && t.fn.transition !== n && O.transition("is supported") ? (C.set.visible(),
                                a.transition({
                                    animation: T.transition + " in",
                                    queue: !1,
                                    debug: T.debug,
                                    verbose: T.verbose,
                                    duration: T.duration,
                                    onComplete: function() {
                                        C.bind.close(),
                                            e.call(a, G),
                                            T.onVisible.call(a, G)
                                    }
                                })) : C.error(k.noTransition)
                        },
                        hide: function(e) {
                            return e = t.isFunction(e) ? e : function() {}
                                ,
                                C.debug("Hiding pop-up"),
                                    T.onHide.call(a, G) === !1 ? void C.debug("onHide callback returned false, cancelling popup animation") : void (T.transition && t.fn.transition !== n && O.transition("is supported") ? a.transition({
                                animation: T.transition + " out",
                                queue: !1,
                                duration: T.duration,
                                debug: T.debug,
                                verbose: T.verbose,
                                onComplete: function() {
                                    C.reset(),
                                        e.call(a, G),
                                        T.onHidden.call(a, G)
                                }
                            }) : C.error(k.noTransition))
                        }
                    },
                    change: {
                        content: function(t) {
                            a.html(t)
                        }
                    },
                    get: {
                        html: function() {
                            return O.removeData(S.html),
                                O.data(S.html) || T.html
                        },
                        title: function() {
                            return O.removeData(S.title),
                                O.data(S.title) || T.title
                        },
                        content: function() {
                            return O.removeData(S.content),
                                O.data(S.content) || O.attr("title") || T.content
                        },
                        variation: function() {
                            return O.removeData(S.variation),
                                O.data(S.variation) || T.variation
                        },
                        popup: function() {
                            return a
                        },
                        popupOffset: function() {
                            return a.offset()
                        },
                        calculations: function() {
                            var t, o = H[0], n = R[0] == e, i = T.inline || T.popup && T.movePopup ? H.position() : H.offset(), r = n ? {
                                top: 0,
                                left: 0
                            } : R.offset(), s = {}, l = n ? {
                                top: p.scrollTop(),
                                left: p.scrollLeft()
                            } : {
                                top: 0,
                                left: 0
                            };
                            return s = {
                                target: {
                                    element: H[0],
                                    width: H.outerWidth(),
                                    height: H.outerHeight(),
                                    top: i.top,
                                    left: i.left,
                                    margin: {}
                                },
                                popup: {
                                    width: a.outerWidth(),
                                    height: a.outerHeight()
                                },
                                parent: {
                                    width: v.outerWidth(),
                                    height: v.outerHeight()
                                },
                                screen: {
                                    top: r.top,
                                    left: r.left,
                                    scroll: {
                                        top: l.top,
                                        left: l.left
                                    },
                                    width: R.width(),
                                    height: R.height()
                                }
                            },
                                T.setFluidWidth && C.is.fluid() && (s.container = {
                                width: a.parent().outerWidth()
                            },
                                s.popup.width = s.container.width),
                                s.target.margin.top = T.inline ? parseInt(e.getComputedStyle(o).getPropertyValue("margin-top"), 10) : 0,
                                s.target.margin.left = T.inline ? C.is.rtl() ? parseInt(e.getComputedStyle(o).getPropertyValue("margin-right"), 10) : parseInt(e.getComputedStyle(o).getPropertyValue("margin-left"), 10) : 0,
                                t = s.screen,
                                s.boundary = {
                                    top: t.top + t.scroll.top,
                                    bottom: t.top + t.scroll.top + t.height,
                                    left: t.left + t.scroll.left,
                                    right: t.left + t.scroll.left + t.width
                                },
                                s
                        },
                        id: function() {
                            return y
                        },
                        startEvent: function() {
                            return "hover" == T.on ? "mouseenter" : "focus" == T.on && "focus"
                        },
                        scrollEvent: function() {
                            return "scroll"
                        },
                        endEvent: function() {
                            return "hover" == T.on ? "mouseleave" : "focus" == T.on && "blur"
                        },
                        distanceFromBoundary: function(t, e) {
                            var o, n, i = {};
                            return e = e || C.get.calculations(),
                                o = e.popup,
                                n = e.boundary,
                                t && (i = {
                                top: t.top - n.top,
                                left: t.left - n.left,
                                right: n.right - (t.left + o.width),
                                bottom: n.bottom - (t.top + o.height)
                            },
                                C.verbose("Distance from boundaries determined", t, i)),
                                i
                        },
                        offsetParent: function(e) {
                            var o = e !== n ? e[0] : O[0]
                                , i = o.parentNode
                                , r = t(i);
                            if (i)
                                for (var a = "none" === r.css("transform"), s = "static" === r.css("position"), p = r.is("html"); i && !p && s && a; )
                                    i = i.parentNode,
                                        r = t(i),
                                        a = "none" === r.css("transform"),
                                        s = "static" === r.css("position"),
                                        p = r.is("html");
                            return r && r.length > 0 ? r : t()
                        },
                        positions: function() {
                            return {
                                "top left": !1,
                                "top center": !1,
                                "top right": !1,
                                "bottom left": !1,
                                "bottom center": !1,
                                "bottom right": !1,
                                "left center": !1,
                                "right center": !1
                            }
                        },
                        nextPosition: function(t) {
                            var e = t.split(" ")
                                , o = e[0]
                                , n = e[1]
                                , i = {
                                    top: "bottom",
                                    bottom: "top",
                                    left: "right",
                                    right: "left"
                                }
                                , r = {
                                    left: "center",
                                    center: "right",
                                    right: "left"
                                }
                                , a = {
                                    "top left": "top center",
                                    "top center": "top right",
                                    "top right": "right center",
                                    "right center": "bottom right",
                                    "bottom right": "bottom center",
                                    "bottom center": "bottom left",
                                    "bottom left": "left center",
                                    "left center": "top left"
                                }
                                , s = "top" == o || "bottom" == o
                                , p = !1
                                , l = !1
                                , u = !1;
                            return M || (C.verbose("All available positions available"),
                                M = C.get.positions()),
                                C.debug("Recording last position tried", t),
                                M[t] = !0,
                                "opposite" === T.prefer && (u = [i[o], n],
                                u = u.join(" "),
                                p = M[u] === !0,
                                C.debug("Trying opposite strategy", u)),
                                "adjacent" === T.prefer && s && (u = [o, r[n]],
                                u = u.join(" "),
                                l = M[u] === !0,
                                C.debug("Trying adjacent strategy", u)),
                                (l || p) && (C.debug("Using backup position", u),
                                u = a[t]),
                                u
                        }
                    },
                    set: {
                        position: function(t, e) {
                            if (0 === H.length || 0 === a.length)
                                return void C.error(k.notFound);
                            var o, i, r, s, p, l, u, c;
                            if (e = e || C.get.calculations(),
                                t = t || O.data(S.position) || T.position,
                                o = O.data(S.offset) || T.offset,
                                i = T.distanceAway,
                                r = e.target,
                                s = e.popup,
                                p = e.parent,
                                0 === r.width && 0 === r.height && !C.is.svg(r.element))
                                return C.debug("Popup target is hidden, no action taken"),
                                    !1;
                            switch (T.inline && (C.debug("Adding margin to calculation", r.margin),
                                    "left center" == t || "right center" == t ? (o += r.margin.top,
                                i += -r.margin.left) : "top left" == t || "top center" == t || "top right" == t ? (o += r.margin.left,
                                i -= r.margin.top) : (o += r.margin.left,
                                i += r.margin.top)),
                                C.debug("Determining popup position from calculations", t, e),
                                C.is.rtl() && (t = t.replace(/left|right/g, function(t) {
                                return "left" == t ? "right" : "left"
                            }),
                                C.debug("RTL: Popup position updated", t)),
                                N == T.maxSearchDepth && "string" == typeof T.lastResort && (t = T.lastResort),
                                t) {
                                case "top left":
                                    l = {
                                        top: "auto",
                                        bottom: p.height - r.top + i,
                                        left: r.left + o,
                                        right: "auto"
                                    };
                                    break;
                                case "top center":
                                    l = {
                                        bottom: p.height - r.top + i,
                                        left: r.left + r.width / 2 - s.width / 2 + o,
                                        top: "auto",
                                        right: "auto"
                                    };
                                    break;
                                case "top right":
                                    l = {
                                        bottom: p.height - r.top + i,
                                        right: p.width - r.left - r.width - o,
                                        top: "auto",
                                        left: "auto"
                                    };
                                    break;
                                case "left center":
                                    l = {
                                        top: r.top + r.height / 2 - s.height / 2 + o,
                                        right: p.width - r.left + i,
                                        left: "auto",
                                        bottom: "auto"
                                    };
                                    break;
                                case "right center":
                                    l = {
                                        top: r.top + r.height / 2 - s.height / 2 + o,
                                        left: r.left + r.width + i,
                                        bottom: "auto",
                                        right: "auto"
                                    };
                                    break;
                                case "bottom left":
                                    l = {
                                        top: r.top + r.height + i,
                                        left: r.left + o,
                                        bottom: "auto",
                                        right: "auto"
                                    };
                                    break;
                                case "bottom center":
                                    l = {
                                        top: r.top + r.height + i,
                                        left: r.left + r.width / 2 - s.width / 2 + o,
                                        bottom: "auto",
                                        right: "auto"
                                    };
                                    break;
                                case "bottom right":
                                    l = {
                                        top: r.top + r.height + i,
                                        right: p.width - r.left - r.width - o,
                                        left: "auto",
                                        bottom: "auto"
                                    }
                            }
                            if (l === n && C.error(k.invalidPosition, t),
                                C.debug("Calculated popup positioning values", l),
                                a.css(l).removeClass(x.position).addClass(t).addClass(x.loading),
                                u = C.get.popupOffset(),
                                c = C.get.distanceFromBoundary(u, e),
                                C.is.offstage(c, t)) {
                                if (C.debug("Position is outside viewport", t),
                                    N < T.maxSearchDepth)
                                    return N++,
                                        t = C.get.nextPosition(t),
                                        C.debug("Trying new position", t),
                                        !!a && C.set.position(t, e);
                                if (!T.lastResort)
                                    return C.debug("Popup could not find a position to display", a),
                                        C.error(k.cannotPlace, G),
                                        C.remove.attempts(),
                                        C.remove.loading(),
                                        C.reset(),
                                        T.onUnplaceable.call(a, G),
                                        !1;
                                C.debug("No position found, showing with last position")
                            }
                            return C.debug("Position is on stage", t),
                                C.remove.attempts(),
                                C.remove.loading(),
                                T.setFluidWidth && C.is.fluid() && C.set.fluidWidth(e),
                                !0
                        },
                        fluidWidth: function(t) {
                            t = t || C.get.calculations(),
                                C.debug("Automatically setting element width to parent width", t.parent.width),
                                a.css("width", t.container.width)
                        },
                        variation: function(t) {
                            t = t || C.get.variation(),
                                t && C.has.popup() && (C.verbose("Adding variation to popup", t),
                                a.addClass(t))
                        },
                        visible: function() {
                            O.addClass(x.visible)
                        }
                    },
                    remove: {
                        loading: function() {
                            a.removeClass(x.loading)
                        },
                        variation: function(t) {
                            t = t || C.get.variation(),
                                t && (C.verbose("Removing variation", t),
                                a.removeClass(t))
                        },
                        visible: function() {
                            O.removeClass(x.visible)
                        },
                        attempts: function() {
                            C.verbose("Resetting all searched positions"),
                                N = 0,
                                M = !1
                        }
                    },
                    bind: {
                        events: function() {
                            C.debug("Binding popup events to module"),
                                "click" == T.on && O.on("click" + A, C.toggle),
                                "hover" == T.on && c && O.on("touchstart" + A, C.event.touchstart),
                                C.get.startEvent() && O.on(C.get.startEvent() + A, C.event.start).on(C.get.endEvent() + A, C.event.end),
                                T.target && C.debug("Target set to element", H),
                                p.on("resize" + w, C.event.resize)
                        },
                        popup: function() {
                            C.verbose("Allowing hover events on popup to prevent closing"),
                                a && C.has.popup() && a.on("mouseenter" + A, C.event.start).on("mouseleave" + A, C.event.end)
                        },
                        close: function() {
                            (T.hideOnScroll === !0 || "auto" == T.hideOnScroll && "click" != T.on) && F.one(C.get.scrollEvent() + w, C.event.hideGracefully),
                                "hover" == T.on && W && (C.verbose("Binding popup close event to document"),
                                s.on("touchstart" + w, function(t) {
                                    C.verbose("Touched away from popup"),
                                        C.event.hideGracefully.call(G, t)
                                })),
                                "click" == T.on && T.closable && (C.verbose("Binding popup close event to document"),
                                s.on("click" + w, function(t) {
                                    C.verbose("Clicked away from popup"),
                                        C.event.hideGracefully.call(G, t)
                                }))
                        }
                    },
                    unbind: {
                        events: function() {
                            p.off(w),
                                O.off(A)
                        },
                        close: function() {
                            s.off(w),
                                F.off(w)
                        }
                    },
                    has: {
                        popup: function() {
                            return a && a.length > 0
                        }
                    },
                    is: {
                        offstage: function(e, o) {
                            var n = [];
                            return t.each(e, function(t, e) {
                                e < -T.jitter && (C.debug("Position exceeds allowable distance from edge", t, e, o),
                                    n.push(t))
                            }),
                                n.length > 0
                        },
                        svg: function(t) {
                            return C.supports.svg() && t instanceof SVGGraphicsElement
                        },
                        active: function() {
                            return O.hasClass(x.active)
                        },
                        animating: function() {
                            return a !== n && a.hasClass(x.animating)
                        },
                        fluid: function() {
                            return a !== n && a.hasClass(x.fluid)
                        },
                        visible: function() {
                            return a !== n && a.hasClass(x.visible)
                        },
                        dropdown: function() {
                            return O.hasClass(x.dropdown)
                        },
                        hidden: function() {
                            return !C.is.visible()
                        },
                        rtl: function() {
                            return "rtl" == O.css("direction")
                        }
                    },
                    reset: function() {
                        C.remove.visible(),
                            T.preserve ? t.fn.transition !== n && a.transition("remove transition") : C.removePopup()
                    },
                    setting: function(e, o) {
                        if (t.isPlainObject(e))
                            t.extend(!0, T, e);
                        else {
                            if (o === n)
                                return T[e];
                            T[e] = o
                        }
                    },
                    internal: function(e, o) {
                        if (t.isPlainObject(e))
                            t.extend(!0, C, e);
                        else {
                            if (o === n)
                                return C[e];
                            C[e] = o
                        }
                    },
                    debug: function() {
                        !T.silent && T.debug && (T.performance ? C.performance.log(arguments) : (C.debug = Function.prototype.bind.call(console.info, console, T.name + ":"),
                            C.debug.apply(console, arguments)))
                    },
                    verbose: function() {
                        !T.silent && T.verbose && T.debug && (T.performance ? C.performance.log(arguments) : (C.verbose = Function.prototype.bind.call(console.info, console, T.name + ":"),
                            C.verbose.apply(console, arguments)))
                    },
                    error: function() {
                        T.silent || (C.error = Function.prototype.bind.call(console.error, console, T.name + ":"),
                            C.error.apply(console, arguments))
                    },
                    performance: {
                        log: function(t) {
                            var e, o, n;
                            T.performance && (e = (new Date).getTime(),
                                n = d || e,
                                o = e - n,
                                d = e,
                                f.push({
                                    Name: t[0],
                                    Arguments: [].slice.call(t, 1) || "",
                                    Element: G,
                                    "Execution Time": o
                                })),
                                clearTimeout(C.performance.timer),
                                C.performance.timer = setTimeout(C.performance.display, 500)
                        },
                        display: function() {
                            var e = T.name + ":"
                                , o = 0;
                            d = !1,
                                clearTimeout(C.performance.timer),
                                t.each(f, function(t, e) {
                                    o += e["Execution Time"]
                                }),
                                e += " " + o + "ms",
                                u && (e += " '" + u + "'"),
                                (console.group !== n || console.table !== n) && f.length > 0 && (console.groupCollapsed(e),
                                console.table ? console.table(f) : t.each(f, function(t, e) {
                                    console.log(e.Name + ": " + e["Execution Time"] + "ms")
                                }),
                                console.groupEnd()),
                                f = []
                        }
                    },
                    invoke: function(e, o, i) {
                        var a, s, p, l = I;
                        return o = o || m,
                            i = G || i,
                            "string" == typeof e && l !== n && (e = e.split(/[\. ]/),
                            a = e.length - 1,
                            t.each(e, function(o, i) {
                                var r = o != a ? i + e[o + 1].charAt(0).toUpperCase() + e[o + 1].slice(1) : e;
                                if (t.isPlainObject(l[r]) && o != a)
                                    l = l[r];
                                else {
                                    if (l[r] !== n)
                                        return s = l[r],
                                            !1;
                                    if (!t.isPlainObject(l[i]) || o == a)
                                        return l[i] !== n && (s = l[i],
                                            !1);
                                    l = l[i]
                                }
                            })),
                            t.isFunction(s) ? p = s.apply(i, o) : s !== n && (p = s),
                            t.isArray(r) ? r.push(p) : r !== n ? r = [r, p] : p !== n && (r = p),
                            s
                    }
                },
                    h ? (I === n && C.initialize(),
                        C.invoke(g)) : (I !== n && I.invoke("destroy"),
                        C.initialize())
            }),
                    r !== n ? r : this
        }
        ,
        t.fn.popup.settings = {
            name: "Popup",
            silent: !1,
            debug: !1,
            verbose: !1,
            performance: !0,
            namespace: "popup",
            observeChanges: !0,
            onCreate: function() {},
            onRemove: function() {},
            onShow: function() {},
            onVisible: function() {},
            onHide: function() {},
            onUnplaceable: function() {},
            onHidden: function() {},
            on: "hover",
            boundary: e,
            addTouchEvents: !0,
            position: "top left",
            variation: "",
            movePopup: !0,
            target: !1,
            popup: !1,
            inline: !1,
            preserve: !1,
            hoverable: !1,
            content: !1,
            html: !1,
            title: !1,
            closable: !0,
            hideOnScroll: "auto",
            exclusive: !1,
            context: "body",
            scrollContext: e,
            prefer: "opposite",
            lastResort: !1,
            delay: {
                show: 50,
                hide: 70
            },
            setFluidWidth: !0,
            duration: 200,
            transition: "scale",
            distanceAway: 0,
            jitter: 2,
            offset: 0,
            maxSearchDepth: 15,
            error: {
                invalidPosition: "The position you specified is not a valid position",
                cannotPlace: "Popup does not fit within the boundaries of the viewport",
                method: "The method you called is not defined.",
                noTransition: "This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",
                notFound: "The target or popup you specified does not exist on the page"
            },
            metadata: {
                activator: "activator",
                content: "content",
                html: "html",
                offset: "offset",
                position: "position",
                title: "title",
                variation: "variation"
            },
            className: {
                active: "active",
                animating: "animating",
                dropdown: "dropdown",
                fluid: "fluid",
                loading: "loading",
                popup: "ui popup",
                position: "top left center bottom right",
                visible: "visible"
            },
            selector: {
                popup: ".ui.popup"
            },
            templates: {
                escape: function(t) {
                    var e = /[&<>"'`]/g
                        , o = /[&<>"'`]/
                        , n = {
                            "&": "&amp;",
                            "<": "&lt;",
                            ">": "&gt;",
                            '"': "&quot;",
                            "'": "&#x27;",
                            "`": "&#x60;"
                        }
                        , i = function(t) {
                            return n[t]
                        };
                    return o.test(t) ? t.replace(e, i) : t
                },
                popup: function(e) {
                    var o = ""
                        , i = t.fn.popup.settings.templates.escape;
                    return typeof e !== n && (typeof e.title !== n && e.title && (e.title = i(e.title),
                        o += '<div class="header">' + e.title + "</div>"),
                        typeof e.content !== n && e.content && (e.content = i(e.content),
                        o += '<div class="content">' + e.content + "</div>")),
                        o
                }
            }
        }
}(jQuery, window, document);
!function(e, t, r, n) {
    "use strict";
    var t = "undefined" != typeof t && t.Math == Math ? t : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
    e.api = e.fn.api = function(r) {
        var o, s = e(e.isFunction(this) ? t : this), i = s.selector || "", a = (new Date).getTime(), u = [], c = arguments[0], d = "string" == typeof c, l = [].slice.call(arguments, 1);
        return s.each(function() {
            var s, g, f, p, m, b, v = e.isPlainObject(r) ? e.extend(!0, {}, e.fn.api.settings, r) : e.extend({}, e.fn.api.settings), h = v.namespace, y = v.metadata, q = v.selector, R = v.error, x = v.className, S = "." + h, A = "module-" + h, k = e(this), T = k.closest(q.form), P = v.stateContext ? e(v.stateContext) : k, j = this, O = P[0], w = k.data(A);
            b = {
                initialize: function() {
                    d || b.bind.events(),
                        b.instantiate()
                },
                instantiate: function() {
                    b.verbose("Storing instance of module", b),
                        w = b,
                        k.data(A, w)
                },
                destroy: function() {
                    b.verbose("Destroying previous module for", j),
                        k.removeData(A).off(S)
                },
                bind: {
                    events: function() {
                        var e = b.get.event();
                        e ? (b.verbose("Attaching API events to element", e),
                            k.on(e + S, b.event.trigger)) : "now" == v.on && (b.debug("Querying API endpoint immediately"),
                            b.query())
                    }
                },
                decode: {
                    json: function(e) {
                        if (e !== n && "string" == typeof e)
                            try {
                                e = JSON.parse(e)
                            } catch (t) {}
                        return e
                    }
                },
                read: {
                    cachedResponse: function(e) {
                        var r;
                        return t.Storage === n ? void b.error(R.noStorage) : (r = sessionStorage.getItem(e),
                            b.debug("Using cached response", e, r),
                            r = b.decode.json(r))
                    }
                },
                write: {
                    cachedResponse: function(r, o) {
                        return o && "" === o ? void b.debug("Response empty, not caching", o) : t.Storage === n ? void b.error(R.noStorage) : (e.isPlainObject(o) && (o = JSON.stringify(o)),
                            sessionStorage.setItem(r, o),
                            void b.verbose("Storing cached response for url", r, o))
                    }
                },
                query: function() {
                    if (b.is.disabled())
                        return void b.debug("Element is disabled API request aborted");
                    if (b.is.loading()) {
                        if (!v.interruptRequests)
                            return void b.debug("Cancelling request, previous request is still pending");
                        b.debug("Interrupting previous request"),
                            b.abort()
                    }
                    return v.defaultData && e.extend(!0, v.urlData, b.get.defaultData()),
                        v.serializeForm && (v.data = b.add.formData(v.data)),
                        g = b.get.settings(),
                            g === !1 ? (b.cancelled = !0,
                        void b.error(R.beforeSend)) : (b.cancelled = !1,
                        f = b.get.templatedURL(),
                            f || b.is.mocked() ? (f = b.add.urlData(f),
                            f || b.is.mocked() ? (g.url = v.base + f,
                        s = e.extend(!0, {}, v, {
                            type: v.method || v.type,
                            data: p,
                            url: v.base + f,
                            beforeSend: v.beforeXHR,
                            success: function() {},
                            failure: function() {},
                            complete: function() {}
                        }),
                        b.debug("Querying URL", s.url),
                        b.verbose("Using AJAX settings", s),
                            "local" === v.cache && b.read.cachedResponse(f) ? (b.debug("Response returned from local cache"),
                        b.request = b.create.request(),
                        void b.request.resolveWith(O, [b.read.cachedResponse(f)])) : void (v.throttle ? v.throttleFirstRequest || b.timer ? (b.debug("Throttling request", v.throttle),
                        clearTimeout(b.timer),
                        b.timer = setTimeout(function() {
                            b.timer && delete b.timer,
                                b.debug("Sending throttled request", p, s.method),
                                b.send.request()
                        }, v.throttle)) : (b.debug("Sending request", p, s.method),
                        b.send.request(),
                        b.timer = setTimeout(function() {}, v.throttle)) : (b.debug("Sending request", p, s.method),
                        b.send.request()))) : void 0) : void b.error(R.missingURL))
                },
                should: {
                    removeError: function() {
                        return v.hideError === !0 || "auto" === v.hideError && !b.is.form()
                    }
                },
                is: {
                    disabled: function() {
                        return k.filter(q.disabled).length > 0
                    },
                    expectingJSON: function() {
                        return "json" === v.dataType || "jsonp" === v.dataType
                    },
                    form: function() {
                        return k.is("form") || P.is("form")
                    },
                    mocked: function() {
                        return v.mockResponse || v.mockResponseAsync || v.response || v.responseAsync
                    },
                    input: function() {
                        return k.is("input")
                    },
                    loading: function() {
                        return !!b.request && "pending" == b.request.state()
                    },
                    abortedRequest: function(e) {
                        return e && e.readyState !== n && 0 === e.readyState ? (b.verbose("XHR request determined to be aborted"),
                            !0) : (b.verbose("XHR request was not aborted"),
                            !1)
                    },
                    validResponse: function(t) {
                        return b.is.expectingJSON() && e.isFunction(v.successTest) ? (b.debug("Checking JSON returned success", v.successTest, t),
                            v.successTest(t) ? (b.debug("Response passed success test", t),
                                !0) : (b.debug("Response failed success test", t),
                                !1)) : (b.verbose("Response is not JSON, skipping validation", v.successTest, t),
                            !0)
                    }
                },
                was: {
                    cancelled: function() {
                        return b.cancelled || !1
                    },
                    succesful: function() {
                        return b.request && "resolved" == b.request.state()
                    },
                    failure: function() {
                        return b.request && "rejected" == b.request.state()
                    },
                    complete: function() {
                        return b.request && ("resolved" == b.request.state() || "rejected" == b.request.state())
                    }
                },
                add: {
                    urlData: function(t, r) {
                        var o, s;
                        return t && (o = t.match(v.regExp.required),
                            s = t.match(v.regExp.optional),
                            r = r || v.urlData,
                            o && (b.debug("Looking for required URL variables", o),
                            e.each(o, function(o, s) {
                                var i = s.indexOf("$") !== -1 ? s.substr(2, s.length - 3) : s.substr(1, s.length - 2)
                                    , a = e.isPlainObject(r) && r[i] !== n ? r[i] : k.data(i) !== n ? k.data(i) : P.data(i) !== n ? P.data(i) : r[i];
                                return a === n ? (b.error(R.requiredParameter, i, t),
                                    t = !1,
                                    !1) : (b.verbose("Found required variable", i, a),
                                    a = v.encodeParameters ? b.get.urlEncodedValue(a) : a,
                                    t = t.replace(s, a),
                                    void 0)
                            })),
                            s && (b.debug("Looking for optional URL variables", o),
                            e.each(s, function(o, s) {
                                var i = s.indexOf("$") !== -1 ? s.substr(3, s.length - 4) : s.substr(2, s.length - 3)
                                    , a = e.isPlainObject(r) && r[i] !== n ? r[i] : k.data(i) !== n ? k.data(i) : P.data(i) !== n ? P.data(i) : r[i];
                                a !== n ? (b.verbose("Optional variable Found", i, a),
                                    t = t.replace(s, a)) : (b.verbose("Optional variable not found", i),
                                    t = t.indexOf("/" + s) !== -1 ? t.replace("/" + s, "") : t.replace(s, ""))
                            }))),
                            t
                    },
                    formData: function(t) {
                        var r, o = e.fn.serializeObject !== n, s = o ? T.serializeObject() : T.serialize();
                        return t = t || v.data,
                            r = e.isPlainObject(t),
                            r ? o ? (b.debug("Extending existing data with form data", t, s),
                                t = e.extend(!0, {}, t, s)) : (b.error(R.missingSerialize),
                                b.debug("Cant extend data. Replacing data with form data", t, s),
                                t = s) : (b.debug("Adding form data", s),
                                t = s),
                            t
                    }
                },
                send: {
                    request: function() {
                        b.set.loading(),
                            b.request = b.create.request(),
                            b.is.mocked() ? b.mockedXHR = b.create.mockedXHR() : b.xhr = b.create.xhr(),
                            v.onRequest.call(O, b.request, b.xhr)
                    }
                },
                event: {
                    trigger: function(e) {
                        b.query(),
                            "submit" != e.type && "click" != e.type || e.preventDefault()
                    },
                    xhr: {
                        always: function() {},
                        done: function(t, r, n) {
                            var o = this
                                , s = (new Date).getTime() - m
                                , i = v.loadingDuration - s
                                , a = !!e.isFunction(v.onResponse) && (b.is.expectingJSON() ? v.onResponse.call(o, e.extend(!0, {}, t)) : v.onResponse.call(o, t));
                            i = i > 0 ? i : 0,
                                a && (b.debug("Modified API response in onResponse callback", v.onResponse, a, t),
                                t = a),
                                i > 0 && b.debug("Response completed early delaying state change by", i),
                                setTimeout(function() {
                                    b.is.validResponse(t) ? b.request.resolveWith(o, [t, n]) : b.request.rejectWith(o, [n, "invalid"])
                                }, i)
                        },
                        fail: function(e, t, r) {
                            var n = this
                                , o = (new Date).getTime() - m
                                , s = v.loadingDuration - o;
                            s = s > 0 ? s : 0,
                                s > 0 && b.debug("Response completed early delaying state change by", s),
                                setTimeout(function() {
                                    b.is.abortedRequest(e) ? b.request.rejectWith(n, [e, "aborted", r]) : b.request.rejectWith(n, [e, "error", t, r])
                                }, s)
                        }
                    },
                    request: {
                        done: function(e, t) {
                            b.debug("Successful API Response", e),
                                "local" === v.cache && f && (b.write.cachedResponse(f, e),
                                b.debug("Saving server response locally", b.cache)),
                                v.onSuccess.call(O, e, k, t)
                        },
                        complete: function(e, t) {
                            var r, n;
                            b.was.succesful() ? (n = e,
                                r = t) : (r = e,
                                n = b.get.responseFromXHR(r)),
                                b.remove.loading(),
                                v.onComplete.call(O, n, k, r)
                        },
                        fail: function(e, t, r) {
                            var o = b.get.responseFromXHR(e)
                                , i = b.get.errorFromRequest(o, t, r);
                            return "aborted" == t ? (b.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)", t, r),
                                v.onAbort.call(O, t, k, e),
                                !0) : ("invalid" == t ? b.debug("JSON did not pass success test. A server-side error has most likely occurred", o) : "error" == t && e !== n && (b.debug("XHR produced a server error", t, r),
                                200 != e.status && r !== n && "" !== r && b.error(R.statusMessage + r, s.url),
                                v.onError.call(O, i, k, e)),
                                v.errorDuration && "aborted" !== t && (b.debug("Adding error state"),
                                b.set.error(),
                                b.should.removeError() && setTimeout(b.remove.error, v.errorDuration)),
                                b.debug("API Request failed", i, e),
                                void v.onFailure.call(O, o, k, e))
                        }
                    }
                },
                create: {
                    request: function() {
                        return e.Deferred().always(b.event.request.complete).done(b.event.request.done).fail(b.event.request.fail)
                    },
                    mockedXHR: function() {
                        var t, r, n, o = !1, s = !1, i = !1, a = v.mockResponse || v.response, u = v.mockResponseAsync || v.responseAsync;
                        return n = e.Deferred().always(b.event.xhr.complete).done(b.event.xhr.done).fail(b.event.xhr.fail),
                            a ? (e.isFunction(a) ? (b.debug("Using specified synchronous callback", a),
                                r = a.call(O, g)) : (b.debug("Using settings specified response", a),
                                r = a),
                                n.resolveWith(O, [r, o, {
                                    responseText: r
                                }])) : e.isFunction(u) && (t = function(e) {
                                b.debug("Async callback returned response", e),
                                    e ? n.resolveWith(O, [e, o, {
                                        responseText: e
                                    }]) : n.rejectWith(O, [{
                                        responseText: e
                                    }, s, i])
                            }
                                ,
                                b.debug("Using specified async response callback", u),
                                u.call(O, g, t)),
                            n
                    },
                    xhr: function() {
                        var t;
                        return t = e.ajax(s).always(b.event.xhr.always).done(b.event.xhr.done).fail(b.event.xhr.fail),
                            b.verbose("Created server request", t, s),
                            t
                    }
                },
                set: {
                    error: function() {
                        b.verbose("Adding error state to element", P),
                            P.addClass(x.error)
                    },
                    loading: function() {
                        b.verbose("Adding loading state to element", P),
                            P.addClass(x.loading),
                            m = (new Date).getTime()
                    }
                },
                remove: {
                    error: function() {
                        b.verbose("Removing error state from element", P),
                            P.removeClass(x.error)
                    },
                    loading: function() {
                        b.verbose("Removing loading state from element", P),
                            P.removeClass(x.loading)
                    }
                },
                get: {
                    responseFromXHR: function(t) {
                        return !!e.isPlainObject(t) && (b.is.expectingJSON() ? b.decode.json(t.responseText) : t.responseText)
                    },
                    errorFromRequest: function(t, r, o) {
                        return e.isPlainObject(t) && t.error !== n ? t.error : v.error[r] !== n ? v.error[r] : o
                    },
                    request: function() {
                        return b.request || !1
                    },
                    xhr: function() {
                        return b.xhr || !1
                    },
                    settings: function() {
                        var t;
                        return t = v.beforeSend.call(O, v),
                            t && (t.success !== n && (b.debug("Legacy success callback detected", t),
                            b.error(R.legacyParameters, t.success),
                            t.onSuccess = t.success),
                            t.failure !== n && (b.debug("Legacy failure callback detected", t),
                            b.error(R.legacyParameters, t.failure),
                            t.onFailure = t.failure),
                            t.complete !== n && (b.debug("Legacy complete callback detected", t),
                            b.error(R.legacyParameters, t.complete),
                            t.onComplete = t.complete)),
                            t === n && b.error(R.noReturnedValue),
                                t === !1 ? t : t !== n ? e.extend(!0, {}, t) : e.extend(!0, {}, v)
                    },
                    urlEncodedValue: function(e) {
                        var r = t.decodeURIComponent(e)
                            , n = t.encodeURIComponent(e)
                            , o = r !== e;
                        return o ? (b.debug("URL value is already encoded, avoiding double encoding", e),
                            e) : (b.verbose("Encoding value using encodeURIComponent", e, n),
                            n)
                    },
                    defaultData: function() {
                        var t = {};
                        return e.isWindow(j) || (b.is.input() ? t.value = k.val() : b.is.form() || (t.text = k.text())),
                            t
                    },
                    event: function() {
                        return e.isWindow(j) || "now" == v.on ? (b.debug("API called without element, no events attached"),
                            !1) : "auto" == v.on ? k.is("input") ? j.oninput !== n ? "input" : j.onpropertychange !== n ? "propertychange" : "keyup" : k.is("form") ? "submit" : "click" : v.on
                    },
                    templatedURL: function(e) {
                        if (e = e || k.data(y.action) || v.action || !1,
                            f = k.data(y.url) || v.url || !1)
                            return b.debug("Using specified url", f),
                                f;
                        if (e) {
                            if (b.debug("Looking up url for action", e, v.api),
                                v.api[e] === n && !b.is.mocked())
                                return void b.error(R.missingAction, v.action, v.api);
                            f = v.api[e]
                        } else
                            b.is.form() && (f = k.attr("action") || P.attr("action") || !1,
                                b.debug("No url or action specified, defaulting to form action", f));
                        return f
                    }
                },
                abort: function() {
                    var e = b.get.xhr();
                    e && "resolved" !== e.state() && (b.debug("Cancelling API request"),
                        e.abort())
                },
                reset: function() {
                    b.remove.error(),
                        b.remove.loading()
                },
                setting: function(t, r) {
                    if (b.debug("Changing setting", t, r),
                        e.isPlainObject(t))
                        e.extend(!0, v, t);
                    else {
                        if (r === n)
                            return v[t];
                        e.isPlainObject(v[t]) ? e.extend(!0, v[t], r) : v[t] = r
                    }
                },
                internal: function(t, r) {
                    if (e.isPlainObject(t))
                        e.extend(!0, b, t);
                    else {
                        if (r === n)
                            return b[t];
                        b[t] = r
                    }
                },
                debug: function() {
                    !v.silent && v.debug && (v.performance ? b.performance.log(arguments) : (b.debug = Function.prototype.bind.call(console.info, console, v.name + ":"),
                        b.debug.apply(console, arguments)))
                },
                verbose: function() {
                    !v.silent && v.verbose && v.debug && (v.performance ? b.performance.log(arguments) : (b.verbose = Function.prototype.bind.call(console.info, console, v.name + ":"),
                        b.verbose.apply(console, arguments)))
                },
                error: function() {
                    v.silent || (b.error = Function.prototype.bind.call(console.error, console, v.name + ":"),
                        b.error.apply(console, arguments))
                },
                performance: {
                    log: function(e) {
                        var t, r, n;
                        v.performance && (t = (new Date).getTime(),
                            n = a || t,
                            r = t - n,
                            a = t,
                            u.push({
                                Name: e[0],
                                Arguments: [].slice.call(e, 1) || "",
                                "Execution Time": r
                            })),
                            clearTimeout(b.performance.timer),
                            b.performance.timer = setTimeout(b.performance.display, 500)
                    },
                    display: function() {
                        var t = v.name + ":"
                            , r = 0;
                        a = !1,
                            clearTimeout(b.performance.timer),
                            e.each(u, function(e, t) {
                                r += t["Execution Time"]
                            }),
                            t += " " + r + "ms",
                            i && (t += " '" + i + "'"),
                            (console.group !== n || console.table !== n) && u.length > 0 && (console.groupCollapsed(t),
                            console.table ? console.table(u) : e.each(u, function(e, t) {
                                console.log(t.Name + ": " + t["Execution Time"] + "ms")
                            }),
                            console.groupEnd()),
                            u = []
                    }
                },
                invoke: function(t, r, s) {
                    var i, a, u, c = w;
                    return r = r || l,
                        s = j || s,
                        "string" == typeof t && c !== n && (t = t.split(/[\. ]/),
                        i = t.length - 1,
                        e.each(t, function(r, o) {
                            var s = r != i ? o + t[r + 1].charAt(0).toUpperCase() + t[r + 1].slice(1) : t;
                            if (e.isPlainObject(c[s]) && r != i)
                                c = c[s];
                            else {
                                if (c[s] !== n)
                                    return a = c[s],
                                        !1;
                                if (!e.isPlainObject(c[o]) || r == i)
                                    return c[o] !== n ? (a = c[o],
                                        !1) : (b.error(R.method, t),
                                        !1);
                                c = c[o]
                            }
                        })),
                        e.isFunction(a) ? u = a.apply(s, r) : a !== n && (u = a),
                        e.isArray(o) ? o.push(u) : o !== n ? o = [o, u] : u !== n && (o = u),
                        a
                }
            },
                d ? (w === n && b.initialize(),
                    b.invoke(c)) : (w !== n && w.invoke("destroy"),
                    b.initialize())
        }),
                o !== n ? o : this
    }
        ,
        e.api.settings = {
            name: "API",
            namespace: "api",
            debug: !1,
            verbose: !1,
            performance: !0,
            api: {},
            cache: !0,
            interruptRequests: !0,
            on: "auto",
            stateContext: !1,
            loadingDuration: 0,
            hideError: "auto",
            errorDuration: 2e3,
            encodeParameters: !0,
            action: !1,
            url: !1,
            base: "",
            urlData: {},
            defaultData: !0,
            serializeForm: !1,
            throttle: 0,
            throttleFirstRequest: !0,
            method: "get",
            data: {},
            dataType: "json",
            mockResponse: !1,
            mockResponseAsync: !1,
            response: !1,
            responseAsync: !1,
            beforeSend: function(e) {
                return e
            },
            beforeXHR: function(e) {},
            onRequest: function(e, t) {},
            onResponse: !1,
            onSuccess: function(e, t) {},
            onComplete: function(e, t) {},
            onFailure: function(e, t) {},
            onError: function(e, t) {},
            onAbort: function(e, t) {},
            successTest: !1,
            error: {
                beforeSend: "The before send function has aborted the request",
                error: "There was an error with your request",
                exitConditions: "API Request Aborted. Exit conditions met",
                JSONParse: "JSON could not be parsed during error handling",
                legacyParameters: "You are using legacy API success callback names",
                method: "The method you called is not defined",
                missingAction: "API action used but no url was defined",
                missingSerialize: "jquery-serialize-object is required to add form data to an existing data object",
                missingURL: "No URL specified for api event",
                noReturnedValue: "The beforeSend callback must return a settings object, beforeSend ignored.",
                noStorage: "Caching responses locally requires session storage",
                parseError: "There was an error parsing your request",
                requiredParameter: "Missing a required URL parameter: ",
                statusMessage: "Server gave an error: ",
                timeout: "Your request timed out"
            },
            regExp: {
                required: /\{\$*[A-z0-9]+\}/g,
                optional: /\{\/\$*[A-z0-9]+\}/g
            },
            className: {
                loading: "loading",
                error: "error"
            },
            selector: {
                disabled: ".disabled",
                form: "form"
            },
            metadata: {
                action: "action",
                url: "url"
            }
        }
}(jQuery, window, document);
!function(e, i) {
    if ("function" == typeof define && define.amd)
        define(["exports", "jquery"], function(e, r) {
            return i(e, r)
        });
    else if ("undefined" != typeof exports) {
        var r = require("jquery");
        i(exports, r)
    } else
        i(e, e.jQuery || e.Zepto || e.ender || e.$)
}(this, function(e, i) {
    function r(e, r) {
        function n(e, i, r) {
            return e[i] = r,
                e
        }
        function a(e, i) {
            for (var r, a = e.match(t.key); void 0 !== (r = a.pop()); )
                if (t.push.test(r)) {
                    var u = s(e.replace(/\[\]$/, ""));
                    i = n([], u, i)
                } else
                    t.fixed.test(r) ? i = n([], r, i) : t.named.test(r) && (i = n({}, r, i));
            return i
        }
        function s(e) {
            return void 0 === h[e] && (h[e] = 0),
                h[e]++
        }
        function u(e) {
            switch (i('[name="' + e.name + '"]', r).attr("type")) {
                case "checkbox":
                    return "on" === e.value ? !0 : e.value;
                default:
                    return e.value
            }
        }
        function f(i) {
            if (!t.validate.test(i.name))
                return this;
            var r = a(i.name, u(i));
            return l = e.extend(!0, l, r),
                this
        }
        function d(i) {
            if (!e.isArray(i))
                throw new Error("formSerializer.addPairs expects an Array");
            for (var r = 0, t = i.length; t > r; r++)
                this.addPair(i[r]);
            return this
        }
        function o() {
            return l
        }
        function c() {
            return JSON.stringify(o())
        }
        var l = {}
            , h = {};
        this.addPair = f,
            this.addPairs = d,
            this.serialize = o,
            this.serializeJSON = c
    }
    var t = {
        validate: /^[a-z_][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,
        key: /[a-z0-9_]+|(?=\[\])/gi,
        push: /^$/,
        fixed: /^\d+$/,
        named: /^[a-z0-9_]+$/i
    };
    return r.patterns = t,
        r.serializeObject = function() {
            return new r(i,this).addPairs(this.serializeArray()).serialize()
        }
        ,
        r.serializeJSON = function() {
            return new r(i,this).addPairs(this.serializeArray()).serializeJSON()
        }
        ,
        "undefined" != typeof i.fn && (i.fn.serializeObject = r.serializeObject,
        i.fn.serializeJSON = r.serializeJSON),
        e.FormSerializer = r,
        r
});
!function(n, e, i, t) {
    "use strict";
    e = "undefined" != typeof e && e.Math == Math ? e : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(),
        n.fn.transition = function() {
            var a, o = n(this), r = o.selector || "", s = (new Date).getTime(), l = [], u = arguments, c = u[0], d = [].slice.call(arguments, 1), m = "string" == typeof c;
            e.requestAnimationFrame || e.mozRequestAnimationFrame || e.webkitRequestAnimationFrame || e.msRequestAnimationFrame || function(n) {
                setTimeout(n, 0)
            }
            ;
            return o.each(function(e) {
                var f, p, g, v, b, y, h, w, C, A = n(this), S = this;
                C = {
                    initialize: function() {
                        f = C.get.settings.apply(S, u),
                            v = f.className,
                            g = f.error,
                            b = f.metadata,
                            w = "." + f.namespace,
                            h = "module-" + f.namespace,
                            p = A.data(h) || C,
                            y = C.get.animationEndEvent(),
                            m && (m = C.invoke(c)),
                            m === !1 && (C.verbose("Converted arguments into settings object", f),
                            f.interval ? C.delay(f.animate) : C.animate(),
                            C.instantiate())
                    },
                    instantiate: function() {
                        C.verbose("Storing instance of module", C),
                            p = C,
                            A.data(h, p)
                    },
                    destroy: function() {
                        C.verbose("Destroying previous module for", S),
                            A.removeData(h)
                    },
                    refresh: function() {
                        C.verbose("Refreshing display type on next animation"),
                            delete C.displayType
                    },
                    forceRepaint: function() {
                        C.verbose("Forcing element repaint");
                        var n = A.parent()
                            , e = A.next();
                        0 === e.length ? A.detach().appendTo(n) : A.detach().insertBefore(e)
                    },
                    repaint: function() {
                        C.verbose("Repainting element");
                        S.offsetWidth
                    },
                    delay: function(n) {
                        var i, a, r = C.get.animationDirection();
                        r || (r = C.can.transition() ? C.get.direction() : "static"),
                            n = n !== t ? n : f.interval,
                            i = "auto" == f.reverse && r == v.outward,
                            a = i || 1 == f.reverse ? (o.length - e) * f.interval : e * f.interval,
                            C.debug("Delaying animation by", a),
                            setTimeout(C.animate, a)
                    },
                    animate: function(n) {
                        if (f = n || f,
                            !C.is.supported())
                            return C.error(g.support),
                                !1;
                        if (C.debug("Preparing animation", f.animation),
                            C.is.animating()) {
                            if (f.queue)
                                return !f.allowRepeats && C.has.direction() && C.is.occurring() && C.queuing !== !0 ? C.debug("Animation is currently occurring, preventing queueing same animation", f.animation) : C.queue(f.animation),
                                    !1;
                            if (!f.allowRepeats && C.is.occurring())
                                return C.debug("Animation is already occurring, will not execute repeated animation", f.animation),
                                    !1;
                            C.debug("New animation started, completing previous early", f.animation),
                                p.complete()
                        }
                        C.can.animate() ? C.set.animating(f.animation) : C.error(g.noAnimation, f.animation, S)
                    },
                    reset: function() {
                        C.debug("Resetting animation to beginning conditions"),
                            C.remove.animationCallbacks(),
                            C.restore.conditions(),
                            C.remove.animating()
                    },
                    queue: function(n) {
                        C.debug("Queueing animation of", n),
                            C.queuing = !0,
                            A.one(y + ".queue" + w, function() {
                                C.queuing = !1,
                                    C.repaint(),
                                    C.animate.apply(this, f)
                            })
                    },
                    complete: function(n) {
                        C.debug("Animation complete", f.animation),
                            C.remove.completeCallback(),
                            C.remove.failSafe(),
                            C.is.looping() || (C.is.outward() ? (C.verbose("Animation is outward, hiding element"),
                            C.restore.conditions(),
                            C.hide()) : C.is.inward() ? (C.verbose("Animation is outward, showing element"),
                            C.restore.conditions(),
                            C.show()) : (C.verbose("Static animation completed"),
                            C.restore.conditions(),
                            f.onComplete.call(S)))
                    },
                    force: {
                        visible: function() {
                            var n = A.attr("style")
                                , e = C.get.userStyle()
                                , i = C.get.displayType()
                                , a = e + "display: " + i + " !important;"
                                , o = A.css("display")
                                , r = n === t || "" === n;
                            o !== i ? (C.verbose("Overriding default display to show element", i),
                                A.attr("style", a)) : r && A.removeAttr("style")
                        },
                        hidden: function() {
                            var n = A.attr("style")
                                , e = A.css("display")
                                , i = n === t || "" === n;
                            "none" === e || C.is.hidden() ? i && A.removeAttr("style") : (C.verbose("Overriding default display to hide element"),
                                A.css("display", "none"))
                        }
                    },
                    has: {
                        direction: function(e) {
                            var i = !1;
                            return e = e || f.animation,
                                "string" == typeof e && (e = e.split(" "),
                                n.each(e, function(n, e) {
                                    e !== v.inward && e !== v.outward || (i = !0)
                                })),
                                i
                        },
                        inlineDisplay: function() {
                            var e = A.attr("style") || "";
                            return n.isArray(e.match(/display.*?;/, ""))
                        }
                    },
                    set: {
                        animating: function(n) {
                            var e;
                            C.remove.completeCallback(),
                                n = n || f.animation,
                                e = C.get.animationClass(n),
                                C.save.animation(e),
                                C.force.visible(),
                                C.remove.hidden(),
                                C.remove.direction(),
                                C.start.animation(e)
                        },
                        duration: function(n, e) {
                            e = e || f.duration,
                                e = "number" == typeof e ? e + "ms" : e,
                                (e || 0 === e) && (C.verbose("Setting animation duration", e),
                                A.css({
                                    "animation-duration": e
                                }))
                        },
                        direction: function(n) {
                            n = n || C.get.direction(),
                                    n == v.inward ? C.set.inward() : C.set.outward()
                        },
                        looping: function() {
                            C.debug("Transition set to loop"),
                                A.addClass(v.looping)
                        },
                        hidden: function() {
                            A.addClass(v.transition).addClass(v.hidden)
                        },
                        inward: function() {
                            C.debug("Setting direction to inward"),
                                A.removeClass(v.outward).addClass(v.inward)
                        },
                        outward: function() {
                            C.debug("Setting direction to outward"),
                                A.removeClass(v.inward).addClass(v.outward)
                        },
                        visible: function() {
                            A.addClass(v.transition).addClass(v.visible)
                        }
                    },
                    start: {
                        animation: function(n) {
                            n = n || C.get.animationClass(),
                                C.debug("Starting tween", n),
                                A.addClass(n).one(y + ".complete" + w, C.complete),
                                f.useFailSafe && C.add.failSafe(),
                                C.set.duration(f.duration),
                                f.onStart.call(S)
                        }
                    },
                    save: {
                        animation: function(n) {
                            C.cache || (C.cache = {}),
                                C.cache.animation = n
                        },
                        displayType: function(n) {
                            "none" !== n && A.data(b.displayType, n)
                        },
                        transitionExists: function(e, i) {
                            n.fn.transition.exists[e] = i,
                                C.verbose("Saving existence of transition", e, i)
                        }
                    },
                    restore: {
                        conditions: function() {
                            var n = C.get.currentAnimation();
                            n && (A.removeClass(n),
                                C.verbose("Removing animation class", C.cache)),
                                C.remove.duration()
                        }
                    },
                    add: {
                        failSafe: function() {
                            var n = C.get.duration();
                            C.timer = setTimeout(function() {
                                A.triggerHandler(y)
                            }, n + f.failSafeDelay),
                                C.verbose("Adding fail safe timer", C.timer)
                        }
                    },
                    remove: {
                        animating: function() {
                            A.removeClass(v.animating)
                        },
                        animationCallbacks: function() {
                            C.remove.queueCallback(),
                                C.remove.completeCallback()
                        },
                        queueCallback: function() {
                            A.off(".queue" + w)
                        },
                        completeCallback: function() {
                            A.off(".complete" + w)
                        },
                        display: function() {
                            A.css("display", "")
                        },
                        direction: function() {
                            A.removeClass(v.inward).removeClass(v.outward)
                        },
                        duration: function() {
                            A.css("animation-duration", "")
                        },
                        failSafe: function() {
                            C.verbose("Removing fail safe timer", C.timer),
                                C.timer && clearTimeout(C.timer)
                        },
                        hidden: function() {
                            A.removeClass(v.hidden)
                        },
                        visible: function() {
                            A.removeClass(v.visible)
                        },
                        looping: function() {
                            C.debug("Transitions are no longer looping"),
                                C.is.looping() && (C.reset(),
                                A.removeClass(v.looping))
                        },
                        transition: function() {
                            A.removeClass(v.visible).removeClass(v.hidden)
                        }
                    },
                    get: {
                        settings: function(e, i, t) {
                            return "object" == typeof e ? n.extend(!0, {}, n.fn.transition.settings, e) : "function" == typeof t ? n.extend({}, n.fn.transition.settings, {
                                animation: e,
                                onComplete: t,
                                duration: i
                            }) : "string" == typeof i || "number" == typeof i ? n.extend({}, n.fn.transition.settings, {
                                animation: e,
                                duration: i
                            }) : "object" == typeof i ? n.extend({}, n.fn.transition.settings, i, {
                                animation: e
                            }) : "function" == typeof i ? n.extend({}, n.fn.transition.settings, {
                                animation: e,
                                onComplete: i
                            }) : n.extend({}, n.fn.transition.settings, {
                                animation: e
                            })
                        },
                        animationClass: function(n) {
                            var e = n || f.animation
                                , i = C.can.transition() && !C.has.direction() ? C.get.direction() + " " : "";
                            return v.animating + " " + v.transition + " " + i + e
                        },
                        currentAnimation: function() {
                            return !(!C.cache || C.cache.animation === t) && C.cache.animation
                        },
                        currentDirection: function() {
                            return C.is.inward() ? v.inward : v.outward
                        },
                        direction: function() {
                            return C.is.hidden() || !C.is.visible() ? v.inward : v.outward
                        },
                        animationDirection: function(e) {
                            var i;
                            return e = e || f.animation,
                                "string" == typeof e && (e = e.split(" "),
                                n.each(e, function(n, e) {
                                    e === v.inward ? i = v.inward : e === v.outward && (i = v.outward)
                                })),
                                !!i && i
                        },
                        duration: function(n) {
                            return n = n || f.duration,
                                n === !1 && (n = A.css("animation-duration") || 0),
                                    "string" == typeof n ? n.indexOf("ms") > -1 ? parseFloat(n) : 1e3 * parseFloat(n) : n
                        },
                        displayType: function() {
                            return f.displayType ? f.displayType : (A.data(b.displayType) === t && C.can.transition(!0),
                                A.data(b.displayType))
                        },
                        userStyle: function(n) {
                            return n = n || A.attr("style") || "",
                                n.replace(/display.*?;/, "")
                        },
                        transitionExists: function(e) {
                            return n.fn.transition.exists[e]
                        },
                        animationStartEvent: function() {
                            var n, e = i.createElement("div"), a = {
                                animation: "animationstart",
                                OAnimation: "oAnimationStart",
                                MozAnimation: "mozAnimationStart",
                                WebkitAnimation: "webkitAnimationStart"
                            };
                            for (n in a)
                                if (e.style[n] !== t)
                                    return a[n];
                            return !1
                        },
                        animationEndEvent: function() {
                            var n, e = i.createElement("div"), a = {
                                animation: "animationend",
                                OAnimation: "oAnimationEnd",
                                MozAnimation: "mozAnimationEnd",
                                WebkitAnimation: "webkitAnimationEnd"
                            };
                            for (n in a)
                                if (e.style[n] !== t)
                                    return a[n];
                            return !1
                        }
                    },
                    can: {
                        transition: function(e) {
                            var i, a, o, r, s, l, u, c = f.animation, d = C.get.transitionExists(c);
                            if (d === t || e) {
                                if (C.verbose("Determining whether animation exists"),
                                    i = A.attr("class"),
                                    a = A.prop("tagName"),
                                    o = n("<" + a + " />").addClass(i).insertAfter(A),
                                    r = o.addClass(c).removeClass(v.inward).removeClass(v.outward).addClass(v.animating).addClass(v.transition).css("animationName"),
                                    s = o.addClass(v.inward).css("animationName"),
                                    u = o.attr("class", i).removeAttr("style").removeClass(v.hidden).removeClass(v.visible).show().css("display"),
                                    C.verbose("Determining final display state", u),
                                    C.save.displayType(u),
                                    o.remove(),
                                    r != s)
                                    C.debug("Direction exists for animation", c),
                                        l = !0;
                                else {
                                    if ("none" == r || !r)
                                        return void C.debug("No animation defined in css", c);
                                    C.debug("Static animation found", c, u),
                                        l = !1
                                }
                                C.save.transitionExists(c, l)
                            }
                            return d !== t ? d : l
                        },
                        animate: function() {
                            return C.can.transition() !== t
                        }
                    },
                    is: {
                        animating: function() {
                            return A.hasClass(v.animating)
                        },
                        inward: function() {
                            return A.hasClass(v.inward)
                        },
                        outward: function() {
                            return A.hasClass(v.outward)
                        },
                        looping: function() {
                            return A.hasClass(v.looping)
                        },
                        occurring: function(n) {
                            return n = n || f.animation,
                                n = "." + n.replace(" ", "."),
                                A.filter(n).length > 0
                        },
                        visible: function() {
                            return A.is(":visible")
                        },
                        hidden: function() {
                            return "hidden" === A.css("visibility")
                        },
                        supported: function() {
                            return y !== !1
                        }
                    },
                    hide: function() {
                        C.verbose("Hiding element"),
                            C.is.animating() && C.reset(),
                            S.blur(),
                            C.remove.display(),
                            C.remove.visible(),
                            C.set.hidden(),
                            C.force.hidden(),
                            f.onHide.call(S),
                            f.onComplete.call(S)
                    },
                    show: function(n) {
                        C.verbose("Showing element", n),
                            C.remove.hidden(),
                            C.set.visible(),
                            C.force.visible(),
                            f.onShow.call(S),
                            f.onComplete.call(S)
                    },
                    toggle: function() {
                        C.is.visible() ? C.hide() : C.show()
                    },
                    stop: function() {
                        C.debug("Stopping current animation"),
                            A.triggerHandler(y)
                    },
                    stopAll: function() {
                        C.debug("Stopping all animation"),
                            C.remove.queueCallback(),
                            A.triggerHandler(y)
                    },
                    clear: {
                        queue: function() {
                            C.debug("Clearing animation queue"),
                                C.remove.queueCallback()
                        }
                    },
                    enable: function() {
                        C.verbose("Starting animation"),
                            A.removeClass(v.disabled)
                    },
                    disable: function() {
                        C.debug("Stopping animation"),
                            A.addClass(v.disabled)
                    },
                    setting: function(e, i) {
                        if (C.debug("Changing setting", e, i),
                            n.isPlainObject(e))
                            n.extend(!0, f, e);
                        else {
                            if (i === t)
                                return f[e];
                            n.isPlainObject(f[e]) ? n.extend(!0, f[e], i) : f[e] = i
                        }
                    },
                    internal: function(e, i) {
                        if (n.isPlainObject(e))
                            n.extend(!0, C, e);
                        else {
                            if (i === t)
                                return C[e];
                            C[e] = i
                        }
                    },
                    debug: function() {
                        !f.silent && f.debug && (f.performance ? C.performance.log(arguments) : (C.debug = Function.prototype.bind.call(console.info, console, f.name + ":"),
                            C.debug.apply(console, arguments)))
                    },
                    verbose: function() {
                        !f.silent && f.verbose && f.debug && (f.performance ? C.performance.log(arguments) : (C.verbose = Function.prototype.bind.call(console.info, console, f.name + ":"),
                            C.verbose.apply(console, arguments)))
                    },
                    error: function() {
                        f.silent || (C.error = Function.prototype.bind.call(console.error, console, f.name + ":"),
                            C.error.apply(console, arguments))
                    },
                    performance: {
                        log: function(n) {
                            var e, i, t;
                            f.performance && (e = (new Date).getTime(),
                                t = s || e,
                                i = e - t,
                                s = e,
                                l.push({
                                    Name: n[0],
                                    Arguments: [].slice.call(n, 1) || "",
                                    Element: S,
                                    "Execution Time": i
                                })),
                                clearTimeout(C.performance.timer),
                                C.performance.timer = setTimeout(C.performance.display, 500)
                        },
                        display: function() {
                            var e = f.name + ":"
                                , i = 0;
                            s = !1,
                                clearTimeout(C.performance.timer),
                                n.each(l, function(n, e) {
                                    i += e["Execution Time"]
                                }),
                                e += " " + i + "ms",
                                r && (e += " '" + r + "'"),
                                o.length > 1 && (e += " (" + o.length + ")"),
                                (console.group !== t || console.table !== t) && l.length > 0 && (console.groupCollapsed(e),
                                console.table ? console.table(l) : n.each(l, function(n, e) {
                                    console.log(e.Name + ": " + e["Execution Time"] + "ms")
                                }),
                                console.groupEnd()),
                                l = []
                        }
                    },
                    invoke: function(e, i, o) {
                        var r, s, l, u = p;
                        return i = i || d,
                            o = S || o,
                            "string" == typeof e && u !== t && (e = e.split(/[\. ]/),
                            r = e.length - 1,
                            n.each(e, function(i, a) {
                                var o = i != r ? a + e[i + 1].charAt(0).toUpperCase() + e[i + 1].slice(1) : e;
                                if (n.isPlainObject(u[o]) && i != r)
                                    u = u[o];
                                else {
                                    if (u[o] !== t)
                                        return s = u[o],
                                            !1;
                                    if (!n.isPlainObject(u[a]) || i == r)
                                        return u[a] !== t && (s = u[a],
                                            !1);
                                    u = u[a]
                                }
                            })),
                            n.isFunction(s) ? l = s.apply(o, i) : s !== t && (l = s),
                            n.isArray(a) ? a.push(l) : a !== t ? a = [a, l] : l !== t && (a = l),
                            s !== t && s
                    }
                },
                    C.initialize()
            }),
                    a !== t ? a : this
        }
        ,
        n.fn.transition.exists = {},
        n.fn.transition.settings = {
            name: "Transition",
            silent: !1,
            debug: !1,
            verbose: !1,
            performance: !0,
            namespace: "transition",
            interval: 0,
            reverse: "auto",
            onStart: function() {},
            onComplete: function() {},
            onShow: function() {},
            onHide: function() {},
            useFailSafe: !0,
            failSafeDelay: 100,
            allowRepeats: !1,
            displayType: !1,
            animation: "fade",
            duration: !1,
            queue: !0,
            metadata: {
                displayType: "display"
            },
            className: {
                animating: "animating",
                disabled: "disabled",
                hidden: "hidden",
                inward: "in",
                loading: "loading",
                looping: "looping",
                outward: "out",
                transition: "transition",
                visible: "visible"
            },
            error: {
                noAnimation: "Element is no longer attached to DOM. Unable to animate.  Use silent setting to surpress this warning in production.",
                repeated: "That animation is already occurring, cancelling repeated animation",
                method: "The method you called is not defined",
                support: "This browser does not support CSS animations"
            }
        }
}(jQuery, window, document);
;(function($, window, document, undefined) {
    "use strict";
    window = (typeof window != 'undefined' && window.Math == Math) ? window : (typeof self != 'undefined' && self.Math == Math) ? self : Function('return this')();
    $.fn.modal = function(parameters) {
        var $allModules = $(this), $window = $(window), $document = $(document), $body = $('body'), moduleSelector = $allModules.selector || '', time = new Date().getTime(), performance = [], query = arguments[0], methodInvoked = (typeof query == 'string'), queryArguments = [].slice.call(arguments, 1), requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) {
                setTimeout(callback, 0);
            }
            , returnedValue;
        $allModules.each(function() {
            var settings = ($.isPlainObject(parameters)) ? $.extend(true, {}, $.fn.modal.settings, parameters) : $.extend({}, $.fn.modal.settings), selector = settings.selector, className = settings.className, namespace = settings.namespace, error = settings.error, eventNamespace = '.' + namespace, moduleNamespace = 'module-' + namespace, $module = $(this), $context = $(settings.context), $close = $module.find(selector.close), $allModals, $otherModals, $focusedElement, $dimmable, $dimmer, element = this, instance = $module.data(moduleNamespace), elementEventNamespace, id, observer, module;
            module = {
                initialize: function() {
                    module.verbose('Initializing dimmer', $context);
                    module.create.id();
                    module.create.dimmer();
                    module.refreshModals();
                    module.bind.events();
                    if (settings.observeChanges) {
                        module.observeChanges();
                    }
                    module.instantiate();
                },
                instantiate: function() {
                    module.verbose('Storing instance of modal');
                    instance = module;
                    $module.data(moduleNamespace, instance);
                },
                create: {
                    dimmer: function() {
                        var defaultSettings = {
                                debug: settings.debug,
                                dimmerName: 'modals',
                                duration: {
                                    show: settings.duration,
                                    hide: settings.duration
                                }
                            }
                            , dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings);
                        if (settings.inverted) {
                            dimmerSettings.variation = (dimmerSettings.variation !== undefined) ? dimmerSettings.variation + ' inverted' : 'inverted';
                        }
                        if ($.fn.dimmer === undefined) {
                            module.error(error.dimmer);
                            return;
                        }
                        module.debug('Creating dimmer with settings', dimmerSettings);
                        $dimmable = $context.dimmer(dimmerSettings);
                        if (settings.detachable) {
                            module.verbose('Modal is detachable, moving content into dimmer');
                            $dimmable.dimmer('add content', $module);
                        } else {
                            module.set.undetached();
                        }
                        if (settings.blurring) {
                            $dimmable.addClass(className.blurring);
                        }
                        $dimmer = $dimmable.dimmer('get dimmer');
                    },
                    id: function() {
                        id = (Math.random().toString(16) + '000000000').substr(2, 8);
                        elementEventNamespace = '.' + id;
                        module.verbose('Creating unique id for element', id);
                    }
                },
                destroy: function() {
                    module.verbose('Destroying previous modal');
                    $module.removeData(moduleNamespace).off(eventNamespace);
                    $window.off(elementEventNamespace);
                    $dimmer.off(elementEventNamespace);
                    $close.off(eventNamespace);
                    $context.dimmer('destroy');
                },
                observeChanges: function() {
                    if ('MutationObserver'in window) {
                        observer = new MutationObserver(function(mutations) {
                                module.debug('DOM tree modified, refreshing');
                                module.refresh();
                            }
                        );
                        observer.observe(element, {
                            childList: true,
                            subtree: true
                        });
                        module.debug('Setting up mutation observer', observer);
                    }
                },
                refresh: function() {
                    module.remove.scrolling();
                    module.cacheSizes();
                    module.set.screenHeight();
                    module.set.type();
                    module.set.position();
                },
                refreshModals: function() {
                    $otherModals = $module.siblings(selector.modal);
                    $allModals = $otherModals.add($module);
                },
                attachEvents: function(selector, event) {
                    var $toggle = $(selector);
                    event = $.isFunction(module[event]) ? module[event] : module.toggle;
                    if ($toggle.length > 0) {
                        module.debug('Attaching modal events to element', selector, event);
                        $toggle.off(eventNamespace).on('click' + eventNamespace, event);
                    } else {
                        module.error(error.notFound, selector);
                    }
                },
                bind: {
                    events: function() {
                        module.verbose('Attaching events');
                        $module.on('click' + eventNamespace, selector.close, module.event.close).on('click' + eventNamespace, selector.approve, module.event.approve).on('click' + eventNamespace, selector.deny, module.event.deny);
                        $window.on('resize' + elementEventNamespace, module.event.resize);
                    }
                },
                get: {
                    id: function() {
                        return (Math.random().toString(16) + '000000000').substr(2, 8);
                    }
                },
                event: {
                    approve: function() {
                        if (settings.onApprove.call(element, $(this)) === false) {
                            module.verbose('Approve callback returned false cancelling hide');
                            return;
                        }
                        module.hide();
                    },
                    deny: function() {
                        if (settings.onDeny.call(element, $(this)) === false) {
                            module.verbose('Deny callback returned false cancelling hide');
                            return;
                        }
                        module.hide();
                    },
                    close: function() {
                        module.hide();
                    },
                    click: function(event) {
                        var $target = $(event.target)
                            , isInModal = ($target.closest(selector.modal).length > 0)
                            , isInDOM = $.contains(document.documentElement, event.target);
                        if (!isInModal && isInDOM) {
                            module.debug('Dimmer clicked, hiding all modals');
                            if (module.is.active()) {
                                module.remove.clickaway();
                                if (settings.allowMultiple) {
                                    module.hide();
                                } else {
                                    module.hideAll();
                                }
                            }
                        }
                    },
                    debounce: function(method, delay) {
                        clearTimeout(module.timer);
                        module.timer = setTimeout(method, delay);
                    },
                    keyboard: function(event) {
                        var keyCode = event.which
                            , escapeKey = 27;
                        if (keyCode == escapeKey) {
                            if (settings.closable) {
                                module.debug('Escape key pressed hiding modal');
                                module.hide();
                            } else {
                                module.debug('Escape key pressed, but closable is set to false');
                            }
                            event.preventDefault();
                        }
                    },
                    resize: function() {
                        if ($dimmable.dimmer('is active')) {
                            requestAnimationFrame(module.refresh);
                        }
                    }
                },
                toggle: function() {
                    if (module.is.active() || module.is.animating()) {
                        module.hide();
                    } else {
                        module.show();
                    }
                },
                show: function(callback) {
                    callback = $.isFunction(callback) ? callback : function() {}
                    ;
                    module.refreshModals();
                    module.showModal(callback);
                },
                hide: function(callback) {
                    callback = $.isFunction(callback) ? callback : function() {}
                    ;
                    module.refreshModals();
                    module.hideModal(callback);
                },
                showModal: function(callback) {
                    callback = $.isFunction(callback) ? callback : function() {}
                    ;
                    if (module.is.animating() || !module.is.active()) {
                        module.showDimmer();
                        module.cacheSizes();
                        module.set.position();
                        module.set.screenHeight();
                        module.set.type();
                        module.set.clickaway();
                        if (!settings.allowMultiple && module.others.active()) {
                            module.hideOthers(module.showModal);
                        } else {
                            settings.onShow.call(element);
                            if (settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
                                module.debug('Showing modal with css animations');
                                $module.transition({
                                    debug: settings.debug,
                                    animation: settings.transition + ' in',
                                    queue: settings.queue,
                                    duration: settings.duration,
                                    useFailSafe: true,
                                    onComplete: function() {
                                        settings.onVisible.apply(element);
                                        if (settings.keyboardShortcuts) {
                                            module.add.keyboardShortcuts();
                                        }
                                        module.save.focus();
                                        module.set.active();
                                        if (settings.autofocus) {
                                            module.set.autofocus();
                                        }
                                        callback();
                                    }
                                });
                            } else {
                                module.error(error.noTransition);
                            }
                        }
                    } else {
                        module.debug('Modal is already visible');
                    }
                },
                hideModal: function(callback, keepDimmed) {
                    callback = $.isFunction(callback) ? callback : function() {}
                    ;
                    module.debug('Hiding modal');
                    if (settings.onHide.call(element, $(this)) === false) {
                        module.verbose('Hide callback returned false cancelling hide');
                        return;
                    }
                    if (module.is.animating() || module.is.active()) {
                        if (settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
                            module.remove.active();
                            $module.transition({
                                debug: settings.debug,
                                animation: settings.transition + ' out',
                                queue: settings.queue,
                                duration: settings.duration,
                                useFailSafe: true,
                                onStart: function() {
                                    if (!module.others.active() && !keepDimmed) {
                                        module.hideDimmer();
                                    }
                                    if (settings.keyboardShortcuts) {
                                        module.remove.keyboardShortcuts();
                                    }
                                },
                                onComplete: function() {
                                    settings.onHidden.call(element);
                                    module.restore.focus();
                                    callback();
                                }
                            });
                        } else {
                            module.error(error.noTransition);
                        }
                    }
                },
                showDimmer: function() {
                    if ($dimmable.dimmer('is animating') || !$dimmable.dimmer('is active')) {
                        module.debug('Showing dimmer');
                        $dimmable.dimmer('show');
                    } else {
                        module.debug('Dimmer already visible');
                    }
                },
                hideDimmer: function() {
                    if ($dimmable.dimmer('is animating') || ($dimmable.dimmer('is active'))) {
                        $dimmable.dimmer('hide', function() {
                            module.remove.clickaway();
                            module.remove.screenHeight();
                        });
                    } else {
                        module.debug('Dimmer is not visible cannot hide');
                        return;
                    }
                },
                hideAll: function(callback) {
                    var $visibleModals = $allModals.filter('.' + className.active + ', .' + className.animating);
                    callback = $.isFunction(callback) ? callback : function() {}
                    ;
                    if ($visibleModals.length > 0) {
                        module.debug('Hiding all visible modals');
                        module.hideDimmer();
                        $visibleModals.modal('hide modal', callback);
                    }
                },
                hideOthers: function(callback) {
                    var $visibleModals = $otherModals.filter('.' + className.active + ', .' + className.animating);
                    callback = $.isFunction(callback) ? callback : function() {}
                    ;
                    if ($visibleModals.length > 0) {
                        module.debug('Hiding other modals', $otherModals);
                        $visibleModals.modal('hide modal', callback, true);
                    }
                },
                others: {
                    active: function() {
                        return ( $otherModals.filter('.' + className.active).length > 0) ;
                    },
                    animating: function() {
                        return ( $otherModals.filter('.' + className.animating).length > 0) ;
                    }
                },
                add: {
                    keyboardShortcuts: function() {
                        module.verbose('Adding keyboard shortcuts');
                        $document.on('keyup' + eventNamespace, module.event.keyboard);
                    }
                },
                save: {
                    focus: function() {
                        $focusedElement = $(document.activeElement).blur();
                    }
                },
                restore: {
                    focus: function() {
                        if ($focusedElement && $focusedElement.length > 0) {
                            $focusedElement.focus();
                        }
                    }
                },
                remove: {
                    active: function() {
                        $module.removeClass(className.active);
                    },
                    clickaway: function() {
                        if (settings.closable) {
                            $dimmer.off('click' + elementEventNamespace);
                        }
                    },
                    bodyStyle: function() {
                        if ($body.attr('style') === '') {
                            module.verbose('Removing style attribute');
                            $body.removeAttr('style');
                        }
                    },
                    screenHeight: function() {
                        module.debug('Removing page height');
                        $body.css('height', '');
                    },
                    keyboardShortcuts: function() {
                        module.verbose('Removing keyboard shortcuts');
                        $document.off('keyup' + eventNamespace);
                    },
                    scrolling: function() {
                        $dimmable.removeClass(className.scrolling);
                        $module.removeClass(className.scrolling);
                    }
                },
                cacheSizes: function() {
                    var modalHeight = $module.outerHeight();
                    if (module.cache === undefined || modalHeight !== 0) {
                        module.cache = {
                            pageHeight: $(document).outerHeight(),
                            height: modalHeight + settings.offset,
                            contextHeight: (settings.context == 'body') ? $(window).height() : $dimmable.height()
                        };
                    }
                    module.debug('Caching modal and container sizes', module.cache);
                },
                can: {
                    fit: function() {
                        return ( (module.cache.height + (settings.padding * 2)) < module.cache.contextHeight) ;
                    }
                },
                is: {
                    active: function() {
                        return $module.hasClass(className.active);
                    },
                    animating: function() {
                        return $module.transition('is supported') ? $module.transition('is animating') : $module.is(':visible');
                    },
                    scrolling: function() {
                        return $dimmable.hasClass(className.scrolling);
                    },
                    modernBrowser: function() {
                        return !(window.ActiveXObject || "ActiveXObject"in window);
                    }
                },
                set: {
                    autofocus: function() {
                        var $inputs = $module.find('[tabindex], :input').filter(':visible')
                            , $autofocus = $inputs.filter('[autofocus]')
                            , $input = ($autofocus.length > 0) ? $autofocus.first() : $inputs.first();
                        if ($input.length > 0) {
                            $input.focus();
                        }
                    },
                    clickaway: function() {
                        if (settings.closable) {
                            $dimmer.on('click' + elementEventNamespace, module.event.click);
                        }
                    },
                    screenHeight: function() {
                        if (module.can.fit()) {
                            $body.css('height', '');
                        } else {
                            module.debug('Modal is taller than page content, resizing page height');
                            $body.css('height', module.cache.height + (settings.padding * 2));
                        }
                    },
                    active: function() {
                        $module.addClass(className.active);
                    },
                    scrolling: function() {
                        $dimmable.addClass(className.scrolling);
                        $module.addClass(className.scrolling);
                    },
                    type: function() {
                        if (module.can.fit()) {
                            module.verbose('Modal fits on screen');
                            if (!module.others.active() && !module.others.animating()) {
                                module.remove.scrolling();
                            }
                        } else {
                            module.verbose('Modal cannot fit on screen setting to scrolling');
                            module.set.scrolling();
                        }
                    },
                    position: function() {
                        module.verbose('Centering modal on page', module.cache);
                        if (module.can.fit()) {
                            $module.css({
                                top: '',
                                marginTop: -(module.cache.height / 2)
                            });
                        } else {
                            $module.css({
                                marginTop: '',
                                top: $document.scrollTop()
                            });
                        }
                    },
                    undetached: function() {
                        $dimmable.addClass(className.undetached);
                    }
                },
                setting: function(name, value) {
                    module.debug('Changing setting', name, value);
                    if ($.isPlainObject(name)) {
                        $.extend(true, settings, name);
                    } else if (value !== undefined) {
                        if ($.isPlainObject(settings[name])) {
                            $.extend(true, settings[name], value);
                        } else {
                            settings[name] = value;
                        }
                    } else {
                        return settings[name];
                    }
                },
                internal: function(name, value) {
                    if ($.isPlainObject(name)) {
                        $.extend(true, module, name);
                    } else if (value !== undefined) {
                        module[name] = value;
                    } else {
                        return module[name];
                    }
                },
                debug: function() {
                    if (!settings.silent && settings.debug) {
                        if (settings.performance) {
                            module.performance.log(arguments);
                        } else {
                            module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
                            module.debug.apply(console, arguments);
                        }
                    }
                },
                verbose: function() {
                    if (!settings.silent && settings.verbose && settings.debug) {
                        if (settings.performance) {
                            module.performance.log(arguments);
                        } else {
                            module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
                            module.verbose.apply(console, arguments);
                        }
                    }
                },
                error: function() {
                    if (!settings.silent) {
                        module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
                        module.error.apply(console, arguments);
                    }
                },
                performance: {
                    log: function(message) {
                        var currentTime, executionTime, previousTime;
                        if (settings.performance) {
                            currentTime = new Date().getTime();
                            previousTime = time || currentTime;
                            executionTime = currentTime - previousTime;
                            time = currentTime;
                            performance.push({
                                'Name': message[0],
                                'Arguments': [].slice.call(message, 1) || '',
                                'Element': element,
                                'Execution Time': executionTime
                            });
                        }
                        clearTimeout(module.performance.timer);
                        module.performance.timer = setTimeout(module.performance.display, 500);
                    },
                    display: function() {
                        var title = settings.name + ':'
                            , totalTime = 0;
                        time = false;
                        clearTimeout(module.performance.timer);
                        $.each(performance, function(index, data) {
                            totalTime += data['Execution Time'];
                        });
                        title += ' ' + totalTime + 'ms';
                        if (moduleSelector) {
                            title += ' \'' + moduleSelector + '\'';
                        }
                        if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
                            console.groupCollapsed(title);
                            if (console.table) {
                                console.table(performance);
                            } else {
                                $.each(performance, function(index, data) {
                                    console.log(data['Name'] + ': ' + data['Execution Time'] + 'ms');
                                });
                            }
                            console.groupEnd();
                        }
                        performance = [];
                    }
                },
                invoke: function(query, passedArguments, context) {
                    var object = instance, maxDepth, found, response;
                    passedArguments = passedArguments || queryArguments;
                    context = element || context;
                    if (typeof query == 'string' && object !== undefined) {
                        query = query.split(/[\. ]/);
                        maxDepth = query.length - 1;
                        $.each(query, function(depth, value) {
                            var camelCaseValue = (depth != maxDepth) ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query;
                            if ($.isPlainObject(object[camelCaseValue]) && (depth != maxDepth)) {
                                object = object[camelCaseValue];
                            } else if (object[camelCaseValue] !== undefined) {
                                found = object[camelCaseValue];
                                return false;
                            } else if ($.isPlainObject(object[value]) && (depth != maxDepth)) {
                                object = object[value];
                            } else if (object[value] !== undefined) {
                                found = object[value];
                                return false;
                            } else {
                                return false;
                            }
                        });
                    }
                    if ($.isFunction(found)) {
                        response = found.apply(context, passedArguments);
                    } else if (found !== undefined) {
                        response = found;
                    }
                    if ($.isArray(returnedValue)) {
                        returnedValue.push(response);
                    } else if (returnedValue !== undefined) {
                        returnedValue = [returnedValue, response];
                    } else if (response !== undefined) {
                        returnedValue = response;
                    }
                    return found;
                }
            };
            if (methodInvoked) {
                if (instance === undefined) {
                    module.initialize();
                }
                module.invoke(query);
            } else {
                if (instance !== undefined) {
                    instance.invoke('destroy');
                }
                module.initialize();
            }
        });
        return (returnedValue !== undefined) ? returnedValue : this;
    }
    ;
    $.fn.modal.settings = {
        name: 'Modal',
        namespace: 'modal',
        silent: false,
        debug: false,
        verbose: false,
        performance: true,
        observeChanges: false,
        allowMultiple: false,
        detachable: true,
        closable: true,
        autofocus: true,
        inverted: false,
        blurring: false,
        dimmerSettings: {
            closable: false,
            useCSS: true
        },
        keyboardShortcuts: true,
        context: 'body',
        queue: false,
        duration: 500,
        offset: 0,
        transition: 'scale',
        padding: 50,
        onShow: function() {},
        onVisible: function() {},
        onHide: function() {
            return true;
        },
        onHidden: function() {},
        onApprove: function() {
            return true;
        },
        onDeny: function() {
            return true;
        },
        selector: {
            close: '> .close',
            approve: '.actions .positive, .actions .approve, .actions .ok',
            deny: '.actions .negative, .actions .deny, .actions .cancel',
            modal: '.ui.modal'
        },
        error: {
            dimmer: 'UI Dimmer, a required component is not included in this page',
            method: 'The method you called is not defined.',
            notFound: 'The element you specified could not be found'
        },
        className: {
            active: 'active',
            animating: 'animating',
            blurring: 'blurring',
            scrolling: 'scrolling',
            undetached: 'undetached'
        }
    };
})(jQuery, window, document);
window.KF5SupportBoxAPI.ready(function() {
    window.KF5SupportBoxAPI.removeButton();
    window.KF5SupportBoxAPI.identify({
        "name": "simple",
        "email": "",
        "phone": "",
        "metadata": [{
            name: '用户类别',
            value: '1'
        }]
    });
});
$('.message .close').on('click', function() {
    $(this).closest('.message').transition('fade');
});
Messenger.options = {
    extraClasses: 'messenger-fixed messenger-on-top',
    theme: 'air'
};
window.KF5SupportBoxAPI.ready(function() {
    $('#im').on('click', function() {
        window.KF5SupportBoxAPI.open(function() {});
    });
});
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?1959ccfcbdb63252c5058e9726b57973";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
$('.parent_window_href').on('click', function() {
    window.parent.location.href = $(this).data('href');
})
$(function() {
    var set_pw_phone_num = $('.set-pw-phone-num');
    set_pw_phone_num.on('submit', function() {
        var phone = $('input[name="phone"]').val();
        var pw1 = $('input[name="pw1"]').val();
        var pw2 = $('input[name="pw2"]').val();
        var verification_num = $('input[name="verification-num"]').val();
        var recommender = $('input[name="recommender"]').val();
        if (phone && pw1 && pw2 && verification_num) {
            data = {
                phone: phone,
                pw1: pw1,
                pw2: pw2,
                verification_num: verification_num,
                recommender: recommender,
                csrfmiddlewaretoken: 'LweVmIRi58E3glqNDhSkvr8rPTLVOcRR'
            };
            if (set_pw_phone_num.form('is valid')) {
                var url = "/set_pw_phone_num/";
                $.post(url, data, function(data) {
                    if (data['successful'] != 'ok') {
                        $('div.errors').html(data['successful'])
                    } else {
                        window.location.reload()
                    }
                })
            }
        }
        return false;
    });
    $.fn.form.settings.templates.prompt = function(errors) {
        return $('<div/>').addClass('error-msg').html(errors[0]);
    }
    ;
    set_pw_phone_num.form({
        inline: true,
        on: 'blur',
        transition: 'fade',
        selector: {
            prompt: '.error-msg'
        },
        fields: {
            phone: {
                identifier: 'phone',
                rules: [{
                    type: 'empty',
                    prompt: '请填写手机号'
                }, {
                    type: 'number',
                    prompt: '必须是手机号码'
                }, {
                    type: 'minLength[11]',
                    prompt: '至少要有11位数字'
                }, {
                    type: 'maxLength[11]',
                    prompt: '最多只有11为数字'
                }]
            },
            pw1: {
                identifier: 'pw1',
                rules: [{
                    type: 'minLength[6]',
                    prompt: '密码至少要有6位'
                }]
            },
            pw2: {
                identifier: 'pw2',
                rules: [{
                    type: 'match[pw1]',
                    prompt: '两次密码不一致'
                }]
            },
            verification_num: {
                identifier: 'verification-num',
                rules: [{
                    type: 'empty',
                    prompt: '不能为空'
                }, {
                    type: 'number',
                    prompt: '必须是数字'
                }, ]
            }
        }
    });
    var wait = 60
    var o = $('.ver-button')
    function time(o) {
        if (wait == 0) {
            o.text("获取验证码")
            $('.send-phone-verification-num.disabled').removeClass('disabled').addClass('enable')
            wait = 60;
        } else {
            o.text("重新发送(" + wait + ")")
            wait--;
            setTimeout(function() {
                time(o)
            }, 1000)
        }
    }
    $('.inline.fields').on('click', '.send-phone-verification-num.enable', function() {
        var phone_num = $('input[name="phone"]').val();
        url = '/in/account/phone_verification/';
        $('.send-phone-verification-num.enable').addClass('disabled').removeClass('enable')
        data = {
            'phone_num': phone_num,
            'csrfmiddlewaretoken': 'LweVmIRi58E3glqNDhSkvr8rPTLVOcRR'
        };
        $.post(url, data, function(data) {
            if (data['succeeful'] == 'sandok') {
                time(o);
            } else {
                alert(data['error'])
                $('.send-phone-verification-num.disabled').removeClass('disabled').addClass('enable')
            }
        })
    })
});
(function($, window, document, undefined) {
    $.fn.calendar = function(parameters) {
        var $allModules = $(this), moduleSelector = $allModules.selector || '', time = new Date().getTime(), performance = [], query = arguments[0], methodInvoked = (typeof query == 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue;
        $allModules.each(function() {
            var settings = ($.isPlainObject(parameters)) ? $.extend(true, {}, $.fn.calendar.settings, parameters) : $.extend({}, $.fn.calendar.settings), className = settings.className, namespace = settings.namespace, selector = settings.selector, formatter = settings.formatter, parser = settings.parser, metadata = settings.metadata, error = settings.error, eventNamespace = '.' + namespace, moduleNamespace = 'module-' + namespace, $module = $(this), $input = $module.find(selector.input), $container = $module.find(selector.popup), $activator = $module.find(selector.activator), element = this, instance = $module.data(moduleNamespace), isTouch, isTouchDown = false, focusDateUsedForRange = false, module;
            module = {
                initialize: function() {
                    module.debug('Initializing calendar for', element);
                    isTouch = module.get.isTouch();
                    module.setup.popup();
                    module.setup.inline();
                    module.setup.input();
                    module.setup.date();
                    module.create.calendar();
                    module.bind.events();
                    module.instantiate();
                },
                instantiate: function() {
                    module.verbose('Storing instance of calendar');
                    instance = module;
                    $module.data(moduleNamespace, instance);
                },
                destroy: function() {
                    module.verbose('Destroying previous calendar for', element);
                    $module.removeData(moduleNamespace);
                    module.unbind.events();
                },
                setup: {
                    popup: function() {
                        if (settings.inline) {
                            return;
                        }
                        if (!$activator.length) {
                            $activator = $module.children().first();
                            if (!$activator.length) {
                                return;
                            }
                        }
                        if ($.fn.popup === undefined) {
                            module.error(error.popup);
                            return;
                        }
                        if (!$container.length) {
                            $container = $('<div/>').addClass(className.popup).prependTo($activator.parent());
                        }
                        $container.addClass(className.calendar);
                        var onVisible = settings.onVisible;
                        var onHidden = settings.onHidden;
                        if (!$input.length) {
                            $container.attr('tabindex', '0');
                            onVisible = function() {
                                module.focus();
                                return settings.onVisible.apply($container, arguments);
                            }
                            ;
                            onHidden = function() {
                                module.blur();
                                return settings.onHidden.apply($container, arguments);
                            }
                            ;
                        }
                        var onShow = function() {
                            module.set.focusDate(module.get.date());
                            module.set.mode(settings.startMode);
                            return settings.onShow.apply($container, arguments);
                        };
                        var on = settings.on || ($input.length ? 'focus' : 'click');
                        var options = $.extend({}, settings.popupOptions, {
                            popup: $container,
                            on: on,
                            hoverable: on === 'hover',
                            onShow: onShow,
                            onVisible: onVisible,
                            onHide: settings.onHide,
                            onHidden: onHidden
                        });
                        module.popup(options);
                    },
                    inline: function() {
                        if ($activator.length && !settings.inline) {
                            return;
                        }
                        $container = $('<div/>').addClass(className.calendar).appendTo($module);
                        if (!$input.length) {
                            $container.attr('tabindex', '0');
                        }
                    },
                    input: function() {
                        if (settings.touchReadonly && $input.length && isTouch) {
                            $input.prop('readonly', true);
                        }
                    },
                    date: function() {
                        if ($input.length) {
                            var val = $input.val();
                            var date = parser.date(val, settings);
                            module.set.date(date, settings.formatInput, false);
                        }
                    }
                },
                create: {
                    calendar: function() {
                        var i, r, c, row, cell;
                        var mode = module.get.mode();
                        var today = new Date();
                        var date = module.get.date();
                        var focusDate = module.get.focusDate();
                        var display = focusDate || date || settings.initialDate || today;
                        display = module.helper.dateInRange(display);
                        if (!focusDate) {
                            focusDate = display;
                            module.set.focusDate(focusDate, false, false);
                        }
                        var minute = display.getMinutes();
                        var hour = display.getHours();
                        var day = display.getDate();
                        var month = display.getMonth();
                        var year = display.getFullYear();
                        var isYear = mode === 'year';
                        var isMonth = mode === 'month';
                        var isDay = mode === 'day';
                        var isHour = mode === 'hour';
                        var isMinute = mode === 'minute';
                        var isTimeOnly = settings.type === 'time';
                        var columns = isDay ? 7 : isHour ? 4 : 3;
                        var columnsString = columns === 7 ? 'seven' : columns === 4 ? 'four' : 'three';
                        var rows = isDay || isHour ? 6 : 4;
                        var firstMonthDayColumn = (new Date(year,month,1).getDay() - settings.firstDayOfWeek % 7 + 7) % 7;
                        if (!settings.constantHeight && isDay) {
                            var requiredCells = new Date(year,month + 1,0).getDate() + firstMonthDayColumn;
                            rows = Math.ceil(requiredCells / 7);
                        }
                        var yearChange = isYear ? 10 : isMonth ? 1 : 0;
                        var monthChange = isDay ? 1 : 0;
                        var dayChange = isHour || isMinute ? 1 : 0;
                        var prevNextDay = isHour || isMinute ? day : 1;
                        var prevDate = new Date(year - yearChange,month - monthChange,prevNextDay - dayChange,hour);
                        var nextDate = new Date(year + yearChange,month + monthChange,prevNextDay + dayChange,hour);
                        var prevLast = isYear ? new Date(Math.ceil(year / 10) * 10 - 9,0,0) : isMonth ? new Date(year,0,0) : isDay ? new Date(year,month,0) : new Date(year,month,day,-1);
                        var nextFirst = isYear ? new Date(Math.ceil(year / 10) * 10 + 1,0,1) : isMonth ? new Date(year + 1,0,1) : isDay ? new Date(year,month + 1,1) : new Date(year,month,day + 1);
                        var table = $('<table/>').addClass(className.table).addClass(columnsString + ' column').addClass(mode);
                        if (!isTimeOnly) {
                            var thead = $('<thead/>').appendTo(table);
                            row = $('<tr/>').appendTo(thead);
                            cell = $('<th/>').attr('colspan', '' + columns).appendTo(row);
                            var headerText = $('<span/>').addClass(className.link).appendTo(cell);
                            headerText.text(formatter.header(display, mode, settings));
                            var newMode = isMonth ? (settings.disableYear ? 'day' : 'year') : isDay ? (settings.disableMonth ? 'year' : 'month') : 'day';
                            headerText.data(metadata.mode, newMode);
                            var prev = $('<span/>').addClass(className.prev).appendTo(cell);
                            prev.data(metadata.focusDate, prevDate);
                            prev.toggleClass(className.disabledCell, !module.helper.isDateInRange(prevLast, mode));
                            $('<i/>').addClass(className.prevIcon).appendTo(prev);
                            var next = $('<span/>').addClass(className.next).appendTo(cell);
                            next.data(metadata.focusDate, nextDate);
                            next.toggleClass(className.disabledCell, !module.helper.isDateInRange(nextFirst, mode));
                            $('<i/>').addClass(className.nextIcon).appendTo(next);
                            if (isDay) {
                                row = $('<tr/>').appendTo(thead);
                                for (i = 0; i < columns; i++) {
                                    cell = $('<th/>').appendTo(row);
                                    cell.text(formatter.dayColumnHeader((i + settings.firstDayOfWeek) % 7, settings));
                                }
                            }
                        }
                        var tbody = $('<tbody/>').appendTo(table);
                        i = isYear ? Math.ceil(year / 10) * 10 - 9 : isDay ? 1 - firstMonthDayColumn : 0;
                        for (r = 0; r < rows; r++) {
                            row = $('<tr/>').appendTo(tbody);
                            for (c = 0; c < columns; c++,
                                i++) {
                                var cellDate = isYear ? new Date(i,month,1,hour,minute) : isMonth ? new Date(year,i,1,hour,minute) : isDay ? new Date(year,month,i,hour,minute) : isHour ? new Date(year,month,day,i) : new Date(year,month,day,hour,i * 5);
                                var cellText = isYear ? i : isMonth ? settings.text.monthsShort[i] : isDay ? cellDate.getDate() : formatter.time(cellDate, settings, true);
                                cell = $('<td/>').addClass(className.cell).appendTo(row);
                                cell.text(cellText);
                                cell.data(metadata.date, cellDate);
                                var disabled = (isDay && cellDate.getMonth() !== month) || !module.helper.isDateInRange(cellDate, mode);
                                var active = module.helper.dateEqual(cellDate, date, mode);
                                cell.toggleClass(className.disabledCell, disabled);
                                cell.toggleClass(className.activeCell, active);
                                if (!isHour && !isMinute) {
                                    cell.toggleClass(className.todayCell, module.helper.dateEqual(cellDate, today, mode));
                                }
                                if (module.helper.dateEqual(cellDate, focusDate, mode)) {
                                    module.set.focusDate(cellDate, false, false);
                                }
                            }
                        }
                        if (settings.today) {
                            var todayRow = $('<tr/>').appendTo(tbody);
                            var todayButton = $('<td/>').attr('colspan', '' + columns).addClass(className.today).appendTo(todayRow);
                            todayButton.text(formatter.today(settings));
                            todayButton.data(metadata.date, today);
                        }
                        module.update.focus(false, table);
                        $container.empty();
                        table.appendTo($container);
                    }
                },
                update: {
                    focus: function(updateRange, container) {
                        container = container || $container;
                        var mode = module.get.mode();
                        var date = module.get.date();
                        var focusDate = module.get.focusDate();
                        var startDate = module.get.startDate();
                        var endDate = module.get.endDate();
                        var rangeDate = (updateRange ? focusDate : null) || date || (!isTouch ? focusDate : null);
                        container.find('td').each(function() {
                            var cell = $(this);
                            var cellDate = cell.data(metadata.date);
                            if (!cellDate) {
                                return;
                            }
                            var disabled = cell.hasClass(className.disabledCell);
                            var active = cell.hasClass(className.activeCell);
                            var focused = module.helper.dateEqual(cellDate, focusDate, mode);
                            var inRange = !rangeDate ? false : ((!!startDate && module.helper.isDateInRange(cellDate, mode, startDate, rangeDate)) || (!!endDate && module.helper.isDateInRange(cellDate, mode, rangeDate, endDate)));
                            cell.toggleClass(className.focusCell, focused && (!isTouch || isTouchDown));
                            cell.toggleClass(className.rangeCell, inRange && !active && !disabled);
                        });
                    }
                },
                refresh: function() {
                    module.create.calendar();
                },
                bind: {
                    events: function() {
                        $container.on('mousedown' + eventNamespace, module.event.mousedown);
                        $container.on('touchstart' + eventNamespace, module.event.mousedown);
                        $container.on('mouseup' + eventNamespace, module.event.mouseup);
                        $container.on('touchend' + eventNamespace, module.event.mouseup);
                        $container.on('mouseover' + eventNamespace, module.event.mouseover);
                        if ($input.length) {
                            $input.on('input' + eventNamespace, module.event.inputChange);
                            $input.on('focus' + eventNamespace, module.event.inputFocus);
                            $input.on('blur' + eventNamespace, module.event.inputBlur);
                            $input.on('click' + eventNamespace, module.event.inputClick);
                            $input.on('keydown' + eventNamespace, module.event.keydown);
                        } else {
                            $container.on('keydown' + eventNamespace, module.event.keydown);
                        }
                    }
                },
                unbind: {
                    events: function() {
                        $container.off(eventNamespace);
                        if ($input.length) {
                            $input.off(eventNamespace);
                        }
                    }
                },
                event: {
                    mouseover: function(event) {
                        var target = $(event.target);
                        var date = target.data(metadata.date);
                        var mousedown = event.buttons === 1;
                        if (date) {
                            module.set.focusDate(date, false, true, mousedown);
                        }
                    },
                    mousedown: function(event) {
                        if ($input.length) {
                            event.preventDefault();
                        }
                        isTouchDown = event.type.indexOf('touch') >= 0;
                        var target = $(event.target);
                        var date = target.data(metadata.date);
                        if (date) {
                            module.set.focusDate(date, false, true, true);
                        }
                    },
                    mouseup: function(event) {
                        module.focus();
                        event.preventDefault();
                        event.stopPropagation();
                        isTouchDown = false;
                        var target = $(event.target);
                        var parent = target.parent();
                        if (parent.data(metadata.date) || parent.data(metadata.focusDate) || parent.data(metadata.mode)) {
                            target = parent;
                        }
                        var date = target.data(metadata.date);
                        var focusDate = target.data(metadata.focusDate);
                        var mode = target.data(metadata.mode);
                        if (date) {
                            var forceSet = target.hasClass(className.today);
                            module.selectDate(date, forceSet);
                        } else if (focusDate) {
                            module.set.focusDate(focusDate);
                        } else if (mode) {
                            module.set.mode(mode);
                        }
                    },
                    keydown: function(event) {
                        if (event.keyCode === 27 || event.keyCode === 9) {
                            module.popup('hide');
                        }
                        if (module.popup('is visible')) {
                            if (event.keyCode === 37 || event.keyCode === 38 || event.keyCode === 39 || event.keyCode === 40) {
                                var mode = module.get.mode();
                                var bigIncrement = mode === 'day' ? 7 : mode === 'hour' ? 4 : 3;
                                var increment = event.keyCode === 37 ? -1 : event.keyCode === 38 ? -bigIncrement : event.keyCode == 39 ? 1 : bigIncrement;
                                increment *= mode === 'minute' ? 5 : 1;
                                var focusDate = module.get.focusDate() || module.get.date() || new Date();
                                var year = focusDate.getFullYear() + (mode === 'year' ? increment : 0);
                                var month = focusDate.getMonth() + (mode === 'month' ? increment : 0);
                                var day = focusDate.getDate() + (mode === 'day' ? increment : 0);
                                var hour = focusDate.getHours() + (mode === 'hour' ? increment : 0);
                                var minute = focusDate.getMinutes() + (mode === 'minute' ? increment : 0);
                                var newFocusDate = new Date(year,month,day,hour,minute);
                                if (settings.type === 'time') {
                                    newFocusDate = module.helper.mergeDateTime(focusDate, newFocusDate);
                                }
                                if (module.helper.isDateInRange(newFocusDate, mode)) {
                                    module.set.focusDate(newFocusDate);
                                }
                            } else if (event.keyCode === 13) {
                                var date = module.get.focusDate();
                                if (date) {
                                    module.selectDate(date);
                                }
                            }
                        }
                        if (event.keyCode === 38 || event.keyCode === 40) {
                            event.preventDefault();
                            module.popup('show');
                        }
                    },
                    inputChange: function() {
                        var val = $input.val();
                        var date = parser.date(val, settings);
                        module.set.date(date, false);
                    },
                    inputFocus: function() {
                        $container.addClass(className.active);
                    },
                    inputBlur: function() {
                        $container.removeClass(className.active);
                        if (settings.formatInput) {
                            var date = module.get.date();
                            var text = formatter.datetime(date, settings);
                            $input.val(text);
                        }
                    },
                    inputClick: function() {
                        module.popup('show');
                    }
                },
                get: {
                    date: function() {
                        return $module.data(metadata.date) || null;
                    },
                    focusDate: function() {
                        return $module.data(metadata.focusDate) || null;
                    },
                    startDate: function() {
                        var startModule = module.get.calendarModule(settings.startCalendar);
                        return (startModule ? startModule.get.date() : $module.data(metadata.startDate)) || null;
                    },
                    endDate: function() {
                        var endModule = module.get.calendarModule(settings.endCalendar);
                        return (endModule ? endModule.get.date() : $module.data(metadata.endDate)) || null;
                    },
                    mode: function() {
                        var mode = $module.data(metadata.mode) || settings.startMode;
                        var validModes = module.get.validModes();
                        if ($.inArray(mode, validModes) >= 0) {
                            return mode;
                        }
                        return settings.type === 'time' ? 'hour' : settings.type === 'month' ? 'month' : settings.type === 'year' ? 'year' : 'day';
                    },
                    validModes: function() {
                        var validModes = [];
                        if (settings.type !== 'time') {
                            if (!settings.disableYear || settings.type === 'year') {
                                validModes.push('year');
                            }
                            if (!(settings.disableMonth || settings.type === 'year') || settings.type === 'month') {
                                validModes.push('month');
                            }
                            if (settings.type.indexOf('date') >= 0) {
                                validModes.push('day');
                            }
                        }
                        if (settings.type.indexOf('time') >= 0) {
                            validModes.push('hour');
                            if (!settings.disableMinute) {
                                validModes.push('minute');
                            }
                        }
                        return validModes;
                    },
                    isTouch: function() {
                        try {
                            document.createEvent('TouchEvent');
                            return true;
                        } catch (e) {
                            return false;
                        }
                    },
                    calendarModule: function(selector) {
                        if (!selector) {
                            return null;
                        }
                        if (!(selector instanceof $)) {
                            selector = $module.parent().children(selector).first();
                        }
                        return selector.data(moduleNamespace);
                    }
                },
                set: {
                    date: function(date, updateInput, fireChange) {
                        updateInput = updateInput !== false;
                        fireChange = fireChange !== false;
                        date = module.helper.sanitiseDate(date);
                        date = module.helper.dateInRange(date);
                        var text = formatter.datetime(date, settings);
                        if (fireChange && settings.onChange.call(element, date, text) === false) {
                            return false;
                        }
                        var endDate = module.get.endDate();
                        if (!!endDate && !!date && date > endDate) {
                            module.set.endDate(undefined);
                        }
                        module.set.dataKeyValue(metadata.date, date);
                        module.set.focusDate(date);
                        if (updateInput && $input.length) {
                            $input.val(text);
                        }
                    },
                    startDate: function(date, refreshCalendar) {
                        date = module.helper.sanitiseDate(date);
                        var startModule = module.get.calendarModule(settings.startCalendar);
                        if (startModule) {
                            startModule.set.date(date);
                        }
                        module.set.dataKeyValue(metadata.startDate, date, refreshCalendar);
                    },
                    endDate: function(date, refreshCalendar) {
                        date = module.helper.sanitiseDate(date);
                        var endModule = module.get.calendarModule(settings.endCalendar);
                        if (endModule) {
                            endModule.set.date(date);
                        }
                        module.set.dataKeyValue(metadata.endDate, date, refreshCalendar);
                    },
                    focusDate: function(date, refreshCalendar, updateFocus, updateRange) {
                        date = module.helper.sanitiseDate(date);
                        date = module.helper.dateInRange(date);
                        var changed = module.set.dataKeyValue(metadata.focusDate, date, refreshCalendar);
                        updateFocus = (updateFocus !== false && changed && refreshCalendar === false) || focusDateUsedForRange != updateRange;
                        focusDateUsedForRange = updateRange;
                        if (updateFocus) {
                            module.update.focus(updateRange);
                        }
                    },
                    mode: function(mode, refreshCalendar) {
                        module.set.dataKeyValue(metadata.mode, mode, refreshCalendar);
                    },
                    dataKeyValue: function(key, value, refreshCalendar) {
                        var oldValue = $module.data(key);
                        var equal = oldValue === value || (oldValue <= value && oldValue >= value);
                        if (value) {
                            $module.data(key, value);
                        } else {
                            $module.removeData(key);
                        }
                        refreshCalendar = refreshCalendar !== false && !equal;
                        if (refreshCalendar) {
                            module.create.calendar();
                        }
                        return !equal;
                    }
                },
                selectDate: function(date, forceSet) {
                    var mode = module.get.mode();
                    var complete = forceSet || mode === 'minute' || (settings.disableMinute && mode === 'hour') || (settings.type === 'date' && mode === 'day') || (settings.type === 'month' && mode === 'month') || (settings.type === 'year' && mode === 'year');
                    if (complete) {
                        var canceled = module.set.date(date) === false;
                        if (!canceled && settings.closable) {
                            module.popup('hide');
                            var endModule = module.get.calendarModule(settings.endCalendar);
                            if (endModule) {
                                endModule.popup('show');
                                endModule.focus();
                            }
                        }
                    } else {
                        var newMode = mode === 'year' ? (!settings.disableMonth ? 'month' : 'day') : mode === 'month' ? 'day' : mode === 'day' ? 'hour' : 'minute';
                        module.set.mode(newMode);
                        if (mode === 'hour' || (mode === 'day' && module.get.date())) {
                            module.set.date(date);
                        } else {
                            module.set.focusDate(date);
                        }
                    }
                },
                changeDate: function(date) {
                    module.set.date(date);
                },
                clear: function() {
                    module.set.date(undefined);
                },
                popup: function() {
                    return $activator.popup.apply($activator, arguments);
                },
                focus: function() {
                    if ($input.length) {
                        $input.focus();
                    } else {
                        $container.focus();
                    }
                },
                blur: function() {
                    if ($input.length) {
                        $input.blur();
                    } else {
                        $container.blur();
                    }
                },
                helper: {
                    sanitiseDate: function(date) {
                        if (!date) {
                            return undefined;
                        }
                        if (!(date instanceof Date)) {
                            date = parser.date('' + date, settings);
                        }
                        if (isNaN(date.getTime())) {
                            return undefined;
                        }
                        return date;
                    },
                    dateDiff: function(date1, date2, mode) {
                        mode = mode || 'day';
                        var isTimeOnly = settings.type === 'time';
                        var isYear = mode === 'year';
                        var isYearOrMonth = isYear || mode === 'month';
                        var isMinute = mode === 'minute';
                        var isHourOrMinute = isMinute || mode === 'hour';
                        date1 = new Date(isTimeOnly ? 2000 : date1.getFullYear(),isTimeOnly ? 0 : isYear ? 0 : date1.getMonth(),isTimeOnly ? 1 : isYearOrMonth ? 1 : date1.getDate(),!isHourOrMinute ? 0 : date1.getHours(),!isMinute ? 0 : Math.floor(date1.getMinutes() / 5));
                        date2 = new Date(isTimeOnly ? 2000 : date2.getFullYear(),isTimeOnly ? 0 : isYear ? 0 : date2.getMonth(),isTimeOnly ? 1 : isYearOrMonth ? 1 : date2.getDate(),!isHourOrMinute ? 0 : date2.getHours(),!isMinute ? 0 : Math.floor(date2.getMinutes() / 5));
                        return date2.getTime() - date1.getTime();
                    },
                    dateEqual: function(date1, date2, mode) {
                        return !!date1 && !!date2 && module.helper.dateDiff(date1, date2, mode) === 0;
                    },
                    isDateInRange: function(date, mode, minDate, maxDate) {
                        if (!minDate && !maxDate) {
                            var startDate = module.get.startDate();
                            minDate = startDate && settings.minDate ? Math.max(startDate, settings.minDate) : startDate || settings.minDate;
                            maxDate = settings.maxDate;
                        }
                        return !(!date || (minDate && module.helper.dateDiff(date, minDate, mode) > 0) || (maxDate && module.helper.dateDiff(maxDate, date, mode) > 0));
                    },
                    dateInRange: function(date, minDate, maxDate) {
                        if (!minDate && !maxDate) {
                            var startDate = module.get.startDate();
                            minDate = startDate && settings.minDate ? Math.max(startDate, settings.minDate) : startDate || settings.minDate;
                            maxDate = settings.maxDate;
                        }
                        var isTimeOnly = settings.type === 'time';
                        return !date ? date : (minDate && module.helper.dateDiff(date, minDate, 'minute') > 0) ? (isTimeOnly ? module.helper.mergeDateTime(date, minDate) : minDate) : (maxDate && module.helper.dateDiff(maxDate, date, 'minute') > 0) ? (isTimeOnly ? module.helper.mergeDateTime(date, maxDate) : maxDate) : date;
                    },
                    mergeDateTime: function(date, time) {
                        return (!date || !time) ? time : new Date(date.getFullYear(),date.getMonth(),date.getDate(),time.getHours(),time.getMinutes());
                    }
                },
                setting: function(name, value) {
                    module.debug('Changing setting', name, value);
                    if ($.isPlainObject(name)) {
                        $.extend(true, settings, name);
                    } else if (value !== undefined) {
                        settings[name] = value;
                    } else {
                        return settings[name];
                    }
                },
                internal: function(name, value) {
                    if ($.isPlainObject(name)) {
                        $.extend(true, module, name);
                    } else if (value !== undefined) {
                        module[name] = value;
                    } else {
                        return module[name];
                    }
                },
                debug: function() {
                    if (settings.debug) {
                        if (settings.performance) {
                            module.performance.log(arguments);
                        } else {
                            module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
                            module.debug.apply(console, arguments);
                        }
                    }
                },
                verbose: function() {
                    if (settings.verbose && settings.debug) {
                        if (settings.performance) {
                            module.performance.log(arguments);
                        } else {
                            module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
                            module.verbose.apply(console, arguments);
                        }
                    }
                },
                error: function() {
                    module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
                    module.error.apply(console, arguments);
                },
                performance: {
                    log: function(message) {
                        var currentTime, executionTime, previousTime;
                        if (settings.performance) {
                            currentTime = new Date().getTime();
                            previousTime = time || currentTime;
                            executionTime = currentTime - previousTime;
                            time = currentTime;
                            performance.push({
                                'Name': message[0],
                                'Arguments': [].slice.call(message, 1) || '',
                                'Element': element,
                                'Execution Time': executionTime
                            });
                        }
                        clearTimeout(module.performance.timer);
                        module.performance.timer = setTimeout(module.performance.display, 500);
                    },
                    display: function() {
                        var title = settings.name + ':'
                            , totalTime = 0;
                        time = false;
                        clearTimeout(module.performance.timer);
                        $.each(performance, function(index, data) {
                            totalTime += data['Execution Time'];
                        });
                        title += ' ' + totalTime + 'ms';
                        if (moduleSelector) {
                            title += ' \'' + moduleSelector + '\'';
                        }
                        if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
                            console.groupCollapsed(title);
                            if (console.table) {
                                console.table(performance);
                            } else {
                                $.each(performance, function(index, data) {
                                    console.log(data['Name'] + ': ' + data['Execution Time'] + 'ms');
                                });
                            }
                            console.groupEnd();
                        }
                        performance = [];
                    }
                },
                invoke: function(query, passedArguments, context) {
                    var object = instance, maxDepth, found, response;
                    passedArguments = passedArguments || queryArguments;
                    context = element || context;
                    if (typeof query == 'string' && object !== undefined) {
                        query = query.split(/[\. ]/);
                        maxDepth = query.length - 1;
                        $.each(query, function(depth, value) {
                            var camelCaseValue = (depth != maxDepth) ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query;
                            if ($.isPlainObject(object[camelCaseValue]) && (depth != maxDepth)) {
                                object = object[camelCaseValue];
                            } else if (object[camelCaseValue] !== undefined) {
                                found = object[camelCaseValue];
                                return false;
                            } else if ($.isPlainObject(object[value]) && (depth != maxDepth)) {
                                object = object[value];
                            } else if (object[value] !== undefined) {
                                found = object[value];
                                return false;
                            } else {
                                module.error(error.method, query);
                                return false;
                            }
                        });
                    }
                    if ($.isFunction(found)) {
                        response = found.apply(context, passedArguments);
                    } else if (found !== undefined) {
                        response = found;
                    }
                    if ($.isArray(returnedValue)) {
                        returnedValue.push(response);
                    } else if (returnedValue !== undefined) {
                        returnedValue = [returnedValue, response];
                    } else if (response !== undefined) {
                        returnedValue = response;
                    }
                    return found;
                }
            };
            if (methodInvoked) {
                if (instance === undefined) {
                    module.initialize();
                }
                module.invoke(query);
            } else {
                if (instance !== undefined) {
                    instance.invoke('destroy');
                }
                module.initialize();
            }
        });
        return (returnedValue !== undefined) ? returnedValue : $allModules;
    }
    ;
    $.fn.calendar.settings = {
        name: 'Calendar',
        namespace: 'calendar',
        debug: false,
        verbose: false,
        performance: false,
        type: 'datetime',
        firstDayOfWeek: 0,
        constantHeight: true,
        today: false,
        closable: true,
        monthFirst: true,
        touchReadonly: true,
        inline: false,
        on: null,
        initialDate: null,
        startMode: false,
        minDate: null,
        maxDate: null,
        ampm: true,
        disableYear: false,
        disableMonth: false,
        disableMinute: false,
        formatInput: true,
        startCalendar: null,
        endCalendar: null,
        popupOptions: {
            position: 'bottom left',
            lastResort: 'bottom left',
            prefer: 'opposite',
            hideOnScroll: false
        },
        text: {
            days: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
            months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
            monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
            today: 'Today',
            now: 'Now',
            am: 'AM',
            pm: 'PM'
        },
        formatter: {
            header: function(date, mode, settings) {
                return mode === 'year' ? settings.formatter.yearHeader(date, settings) : mode === 'month' ? settings.formatter.monthHeader(date, settings) : mode === 'day' ? settings.formatter.dayHeader(date, settings) : mode === 'hour' ? settings.formatter.hourHeader(date, settings) : settings.formatter.minuteHeader(date, settings);
            },
            yearHeader: function(date, settings) {
                var decadeYear = Math.ceil(date.getFullYear() / 10) * 10;
                return (decadeYear - 9) + ' - ' + (decadeYear + 2);
            },
            monthHeader: function(date, settings) {
                return date.getFullYear();
            },
            dayHeader: function(date, settings) {
                var month = settings.text.months[date.getMonth()];
                var year = date.getFullYear();
                return month + ' ' + year;
            },
            hourHeader: function(date, settings) {
                return settings.formatter.date(date, settings);
            },
            minuteHeader: function(date, settings) {
                return settings.formatter.date(date, settings);
            },
            dayColumnHeader: function(day, settings) {
                return settings.text.days[day];
            },
            datetime: function(date, settings) {
                if (!date) {
                    return '';
                }
                var day = settings.type === 'time' ? '' : settings.formatter.date(date, settings);
                var time = settings.type.indexOf('time') < 0 ? '' : settings.formatter.time(date, settings, false);
                var separator = settings.type === 'datetime' ? ' ' : '';
                return day + separator + time;
            },
            date: function(date, settings) {
                if (!date) {
                    return '';
                }
                var day = date.getDate();
                var month = settings.text.months[date.getMonth()];
                var year = date.getFullYear();
                return settings.type === 'year' ? year : settings.type === 'month' ? month + ' ' + year : (settings.monthFirst ? month + ' ' + day : day + ' ' + month) + ', ' + year;
            },
            time: function(date, settings, forCalendar) {
                if (!date) {
                    return '';
                }
                var hour = date.getHours();
                var minute = date.getMinutes();
                var ampm = '';
                if (settings.ampm) {
                    ampm = ' ' + (hour < 12 ? settings.text.am : settings.text.pm);
                    hour = hour === 0 ? 12 : hour > 12 ? hour - 12 : hour;
                }
                return hour + ':' + (minute < 10 ? '0' : '') + minute + ampm;
            },
            today: function(settings) {
                return settings.type === 'date' ? settings.text.today : settings.text.now;
            }
        },
        parser: {
            date: function(text, settings) {
                if (!text) {
                    return null;
                }
                text = ('' + text).trim().toLowerCase();
                if (text.length === 0) {
                    return null;
                }
                var i, j, k;
                var minute = -1
                    , hour = -1
                    , day = -1
                    , month = -1
                    , year = -1;
                var isAm = undefined;
                var isTimeOnly = settings.type === 'time';
                var isDateOnly = settings.type.indexOf('time') < 0;
                var words = text.split(settings.regExp.dateWords);
                var numbers = text.split(settings.regExp.dateNumbers);
                if (!isDateOnly) {
                    isAm = $.inArray(settings.text.am.toLowerCase(), words) >= 0 ? true : $.inArray(settings.text.pm.toLowerCase(), words) >= 0 ? false : undefined;
                    for (i = 0; i < numbers.length; i++) {
                        var number = numbers[i];
                        if (number.indexOf(':') >= 0) {
                            if (hour < 0 || minute < 0) {
                                var parts = number.split(':');
                                for (k = 0; k < Math.min(2, parts.length); k++) {
                                    j = parseInt(parts[k]);
                                    if (isNaN(j)) {
                                        j = 0;
                                    }
                                    if (k === 0) {
                                        hour = j % 24;
                                    } else {
                                        minute = j % 60;
                                    }
                                }
                            }
                            numbers.splice(i, 1);
                        }
                    }
                }
                if (!isTimeOnly) {
                    for (i = 0; i < words.length; i++) {
                        var word = words[i];
                        if (word.length <= 0) {
                            continue;
                        }
                        word = word.substring(0, Math.min(word.length, 3));
                        for (j = 0; j < settings.text.months.length; j++) {
                            var monthString = settings.text.months[j];
                            monthString = monthString.substring(0, Math.min(word.length, Math.min(monthString.length, 3))).toLowerCase();
                            if (monthString === word) {
                                month = j + 1;
                                break;
                            }
                        }
                        if (month >= 0) {
                            break;
                        }
                    }
                    for (i = 0; i < numbers.length; i++) {
                        j = parseInt(numbers[i]);
                        if (isNaN(j)) {
                            continue;
                        }
                        if (j > 59) {
                            year = j;
                            numbers.splice(i, 1);
                            break;
                        }
                    }
                    if (month < 0) {
                        for (i = 0; i < numbers.length; i++) {
                            k = i > 1 || settings.monthFirst ? i : i === 1 ? 0 : 1;
                            j = parseInt(numbers[k]);
                            if (isNaN(j)) {
                                continue;
                            }
                            if (1 <= j && j <= 12) {
                                month = j;
                                numbers.splice(k, 1);
                                break;
                            }
                        }
                    }
                    for (i = 0; i < numbers.length; i++) {
                        j = parseInt(numbers[i]);
                        if (isNaN(j)) {
                            continue;
                        }
                        if (1 <= j && j <= 31) {
                            day = j;
                            numbers.splice(i, 1);
                            break;
                        }
                    }
                    if (year < 0) {
                        for (i = numbers.length - 1; i >= 0; i--) {
                            j = parseInt(numbers[i]);
                            if (isNaN(j)) {
                                continue;
                            }
                            if (j < 99) {
                                j += 2000;
                            }
                            year = j;
                            numbers.splice(i, 1);
                            break;
                        }
                    }
                }
                if (!isDateOnly) {
                    if (hour < 0) {
                        for (i = 0; i < numbers.length; i++) {
                            j = parseInt(numbers[i]);
                            if (isNaN(j)) {
                                continue;
                            }
                            if (0 <= j && j <= 23) {
                                hour = j;
                                numbers.splice(i, 1);
                                break;
                            }
                        }
                    }
                    if (minute < 0) {
                        for (i = 0; i < numbers.length; i++) {
                            j = parseInt(numbers[i]);
                            if (isNaN(j)) {
                                continue;
                            }
                            if (0 <= j && j <= 59) {
                                minute = j;
                                numbers.splice(i, 1);
                                break;
                            }
                        }
                    }
                }
                if (minute < 0 && hour < 0 && day < 0 && month < 0 && year < 0) {
                    return null;
                }
                if (minute < 0) {
                    minute = 0;
                }
                if (hour < 0) {
                    hour = 0;
                }
                if (day < 0) {
                    day = 1;
                }
                if (month < 0) {
                    month = 1;
                }
                if (year < 0) {
                    year = new Date().getFullYear();
                }
                if (isAm !== undefined) {
                    if (isAm) {
                        if (hour === 12) {
                            hour = 0;
                        }
                    } else if (hour < 12) {
                        hour += 12;
                    }
                }
                var date = new Date(year,month - 1,day,hour,minute);
                if (date.getMonth() !== month - 1 || date.getFullYear() !== year) {
                    date = new Date(year,month,0,hour,minute);
                }
                return isNaN(date.getTime()) ? null : date;
            }
        },
        onChange: function(date, text) {
            return true;
        },
        onShow: function() {},
        onVisible: function() {},
        onHide: function() {},
        onHidden: function() {},
        selector: {
            popup: '.ui.popup',
            input: 'input',
            activator: 'input'
        },
        regExp: {
            dateWords: /[^A-Za-z\u00C0-\u024F]+/g,
            dateNumbers: /[^\d:]+/g
        },
        error: {
            popup: 'UI Popup, a required component is not included in this page',
            method: 'The method you called is not defined.'
        },
        className: {
            calendar: 'calendar',
            active: 'active',
            popup: 'ui popup',
            table: 'ui celled center aligned unstackable table',
            prev: 'prev link',
            next: 'next link',
            prevIcon: 'chevron left icon',
            nextIcon: 'chevron right icon',
            link: 'link',
            cell: 'link',
            disabledCell: 'disabled',
            activeCell: 'active',
            rangeCell: 'range',
            focusCell: 'focus',
            todayCell: 'today',
            today: 'today link'
        },
        metadata: {
            date: 'date',
            focusDate: 'focusDate',
            startDate: 'startDate',
            endDate: 'endDate',
            mode: 'mode'
        }
    };
})(jQuery, window, document);
!function(t, e, o, n) {
    "use strict";
    e = "undefined" != typeof e && e.Math == Math ? e : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(),
        t.fn.popup = function(i) {
            var r, a = t(this), s = t(o), p = t(e), l = t("body"), u = a.selector || "", c = !0, d = (new Date).getTime(), f = [], g = arguments[0], h = "string" == typeof g, m = [].slice.call(arguments, 1);
            return a.each(function() {
                var a, v, b, w, y, C, T = t.isPlainObject(i) ? t.extend(!0, {}, t.fn.popup.settings, i) : t.extend({}, t.fn.popup.settings), P = T.selector, x = T.className, k = T.error, S = T.metadata, E = T.namespace, A = "." + T.namespace, D = "module-" + E, O = t(this), j = t(T.context), F = t(T.scrollContext), R = t(T.boundary), H = T.target ? t(T.target) : O, N = 0, M = !1, W = !1, G = this, I = O.data(D);
                C = {
                    initialize: function() {
                        C.debug("Initializing", O),
                            C.createID(),
                            C.bind.events(),
                            !C.exists() && T.preserve && C.create(),
                            T.observeChanges && C.observeChanges(),
                            C.instantiate()
                    },
                    instantiate: function() {
                        C.verbose("Storing instance", C),
                            I = C,
                            O.data(D, I)
                    },
                    observeChanges: function() {
                        "MutationObserver"in e && (b = new MutationObserver(C.event.documentChanged),
                            b.observe(o, {
                                childList: !0,
                                subtree: !0
                            }),
                            C.debug("Setting up mutation observer", b))
                    },
                    refresh: function() {
                        T.popup ? a = t(T.popup).eq(0) : T.inline && (a = H.nextAll(P.popup).eq(0),
                            T.popup = a),
                            T.popup ? (a.addClass(x.loading),
                                v = C.get.offsetParent(),
                                a.removeClass(x.loading),
                                T.movePopup && C.has.popup() && C.get.offsetParent(a)[0] !== v[0] && (C.debug("Moving popup to the same offset parent as activating element"),
                                a.detach().appendTo(v))) : v = T.inline ? C.get.offsetParent(H) : C.has.popup() ? C.get.offsetParent(a) : l,
                            v.is("html") && v[0] !== l[0] && (C.debug("Setting page as offset parent"),
                            v = l),
                            C.get.variation() && C.set.variation()
                    },
                    reposition: function() {
                        C.refresh(),
                            C.set.position()
                    },
                    destroy: function() {
                        C.debug("Destroying previous module"),
                            b && b.disconnect(),
                            a && !T.preserve && C.removePopup(),
                            clearTimeout(C.hideTimer),
                            clearTimeout(C.showTimer),
                            C.unbind.close(),
                            C.unbind.events(),
                            O.removeData(D)
                    },
                    event: {
                        start: function(e) {
                            var o = t.isPlainObject(T.delay) ? T.delay.show : T.delay;
                            clearTimeout(C.hideTimer),
                                W || (C.showTimer = setTimeout(C.show, o))
                        },
                        end: function() {
                            var e = t.isPlainObject(T.delay) ? T.delay.hide : T.delay;
                            clearTimeout(C.showTimer),
                                C.hideTimer = setTimeout(C.hide, e)
                        },
                        touchstart: function(t) {
                            W = !0,
                                C.show()
                        },
                        resize: function() {
                            C.is.visible() && C.set.position()
                        },
                        documentChanged: function(e) {
                            [].forEach.call(e, function(e) {
                                e.removedNodes && [].forEach.call(e.removedNodes, function(e) {
                                    (e == G || t(e).find(G).length > 0) && (C.debug("Element removed from DOM, tearing down events"),
                                        C.destroy())
                                })
                            })
                        },
                        hideGracefully: function(e) {
                            var n = t(e.target)
                                , i = t.contains(o.documentElement, e.target)
                                , r = n.closest(P.popup).length > 0;
                            e && !r && i ? (C.debug("Click occurred outside popup hiding popup"),
                                C.hide()) : C.debug("Click was inside popup, keeping popup open")
                        }
                    },
                    create: function() {
                        var e = C.get.html()
                            , o = C.get.title()
                            , n = C.get.content();
                        e || n || o ? (C.debug("Creating pop-up html"),
                            e || (e = T.templates.popup({
                            title: o,
                            content: n
                        })),
                            a = t("<div/>").addClass(x.popup).data(S.activator, O).html(e),
                            T.inline ? (C.verbose("Inserting popup element inline", a),
                                a.insertAfter(O)) : (C.verbose("Appending popup element to body", a),
                                a.appendTo(j)),
                            C.refresh(),
                            C.set.variation(),
                            T.hoverable && C.bind.popup(),
                            T.onCreate.call(a, G)) : 0 !== H.next(P.popup).length ? (C.verbose("Pre-existing popup found"),
                            T.inline = !0,
                            T.popup = H.next(P.popup).data(S.activator, O),
                            C.refresh(),
                            T.hoverable && C.bind.popup()) : T.popup ? (t(T.popup).data(S.activator, O),
                            C.verbose("Used popup specified in settings"),
                            C.refresh(),
                            T.hoverable && C.bind.popup()) : C.debug("No content specified skipping display", G)
                    },
                    createID: function() {
                        y = (Math.random().toString(16) + "000000000").substr(2, 8),
                            w = "." + y,
                            C.verbose("Creating unique id for element", y)
                    },
                    toggle: function() {
                        C.debug("Toggling pop-up"),
                            C.is.hidden() ? (C.debug("Popup is hidden, showing pop-up"),
                                C.unbind.close(),
                                C.show()) : (C.debug("Popup is visible, hiding pop-up"),
                                C.hide())
                    },
                    show: function(t) {
                        if (t = t || function() {}
                            ,
                            C.debug("Showing pop-up", T.transition),
                            C.is.hidden() && (!C.is.active() || !C.is.dropdown())) {
                            if (C.exists() || C.create(),
                                T.onShow.call(a, G) === !1)
                                return void C.debug("onShow callback returned false, cancelling popup animation");
                            T.preserve || T.popup || C.refresh(),
                                a && C.set.position() && (C.save.conditions(),
                                T.exclusive && C.hideAll(),
                                C.animate.show(t))
                        }
                    },
                    hide: function(t) {
                        if (t = t || function() {}
                            ,
                            C.is.visible() || C.is.animating()) {
                            if (T.onHide.call(a, G) === !1)
                                return void C.debug("onHide callback returned false, cancelling popup animation");
                            C.remove.visible(),
                                C.unbind.close(),
                                C.restore.conditions(),
                                C.animate.hide(t)
                        }
                    },
                    hideAll: function() {
                        t(P.popup).filter("." + x.visible).each(function() {
                            t(this).data(S.activator).popup("hide")
                        })
                    },
                    exists: function() {
                        return !!a && (T.inline || T.popup ? C.has.popup() : a.closest(j).length >= 1)
                    },
                    removePopup: function() {
                        C.has.popup() && !T.popup && (C.debug("Removing popup", a),
                            a.remove(),
                            a = n,
                            T.onRemove.call(a, G))
                    },
                    save: {
                        conditions: function() {
                            C.cache = {
                                title: O.attr("title")
                            },
                                C.cache.title && O.removeAttr("title"),
                                C.verbose("Saving original attributes", C.cache.title)
                        }
                    },
                    restore: {
                        conditions: function() {
                            return C.cache && C.cache.title && (O.attr("title", C.cache.title),
                                C.verbose("Restoring original attributes", C.cache.title)),
                                !0
                        }
                    },
                    supports: {
                        svg: function() {
                            return typeof SVGGraphicsElement === n
                        }
                    },
                    animate: {
                        show: function(e) {
                            e = t.isFunction(e) ? e : function() {}
                                ,
                                    T.transition && t.fn.transition !== n && O.transition("is supported") ? (C.set.visible(),
                                a.transition({
                                    animation: T.transition + " in",
                                    queue: !1,
                                    debug: T.debug,
                                    verbose: T.verbose,
                                    duration: T.duration,
                                    onComplete: function() {
                                        C.bind.close(),
                                            e.call(a, G),
                                            T.onVisible.call(a, G)
                                    }
                                })) : C.error(k.noTransition)
                        },
                        hide: function(e) {
                            return e = t.isFunction(e) ? e : function() {}
                                ,
                                C.debug("Hiding pop-up"),
                                    T.onHide.call(a, G) === !1 ? void C.debug("onHide callback returned false, cancelling popup animation") : void (T.transition && t.fn.transition !== n && O.transition("is supported") ? a.transition({
                                animation: T.transition + " out",
                                queue: !1,
                                duration: T.duration,
                                debug: T.debug,
                                verbose: T.verbose,
                                onComplete: function() {
                                    C.reset(),
                                        e.call(a, G),
                                        T.onHidden.call(a, G)
                                }
                            }) : C.error(k.noTransition))
                        }
                    },
                    change: {
                        content: function(t) {
                            a.html(t)
                        }
                    },
                    get: {
                        html: function() {
                            return O.removeData(S.html),
                                O.data(S.html) || T.html
                        },
                        title: function() {
                            return O.removeData(S.title),
                                O.data(S.title) || T.title
                        },
                        content: function() {
                            return O.removeData(S.content),
                                O.data(S.content) || O.attr("title") || T.content
                        },
                        variation: function() {
                            return O.removeData(S.variation),
                                O.data(S.variation) || T.variation
                        },
                        popup: function() {
                            return a
                        },
                        popupOffset: function() {
                            return a.offset()
                        },
                        calculations: function() {
                            var t, o = H[0], n = R[0] == e, i = T.inline || T.popup && T.movePopup ? H.position() : H.offset(), r = n ? {
                                top: 0,
                                left: 0
                            } : R.offset(), s = {}, l = n ? {
                                top: p.scrollTop(),
                                left: p.scrollLeft()
                            } : {
                                top: 0,
                                left: 0
                            };
                            return s = {
                                target: {
                                    element: H[0],
                                    width: H.outerWidth(),
                                    height: H.outerHeight(),
                                    top: i.top,
                                    left: i.left,
                                    margin: {}
                                },
                                popup: {
                                    width: a.outerWidth(),
                                    height: a.outerHeight()
                                },
                                parent: {
                                    width: v.outerWidth(),
                                    height: v.outerHeight()
                                },
                                screen: {
                                    top: r.top,
                                    left: r.left,
                                    scroll: {
                                        top: l.top,
                                        left: l.left
                                    },
                                    width: R.width(),
                                    height: R.height()
                                }
                            },
                                T.setFluidWidth && C.is.fluid() && (s.container = {
                                width: a.parent().outerWidth()
                            },
                                s.popup.width = s.container.width),
                                s.target.margin.top = T.inline ? parseInt(e.getComputedStyle(o).getPropertyValue("margin-top"), 10) : 0,
                                s.target.margin.left = T.inline ? C.is.rtl() ? parseInt(e.getComputedStyle(o).getPropertyValue("margin-right"), 10) : parseInt(e.getComputedStyle(o).getPropertyValue("margin-left"), 10) : 0,
                                t = s.screen,
                                s.boundary = {
                                    top: t.top + t.scroll.top,
                                    bottom: t.top + t.scroll.top + t.height,
                                    left: t.left + t.scroll.left,
                                    right: t.left + t.scroll.left + t.width
                                },
                                s
                        },
                        id: function() {
                            return y
                        },
                        startEvent: function() {
                            return "hover" == T.on ? "mouseenter" : "focus" == T.on && "focus"
                        },
                        scrollEvent: function() {
                            return "scroll"
                        },
                        endEvent: function() {
                            return "hover" == T.on ? "mouseleave" : "focus" == T.on && "blur"
                        },
                        distanceFromBoundary: function(t, e) {
                            var o, n, i = {};
                            return e = e || C.get.calculations(),
                                o = e.popup,
                                n = e.boundary,
                                t && (i = {
                                top: t.top - n.top,
                                left: t.left - n.left,
                                right: n.right - (t.left + o.width),
                                bottom: n.bottom - (t.top + o.height)
                            },
                                C.verbose("Distance from boundaries determined", t, i)),
                                i
                        },
                        offsetParent: function(e) {
                            var o = e !== n ? e[0] : O[0]
                                , i = o.parentNode
                                , r = t(i);
                            if (i)
                                for (var a = "none" === r.css("transform"), s = "static" === r.css("position"), p = r.is("html"); i && !p && s && a; )
                                    i = i.parentNode,
                                        r = t(i),
                                        a = "none" === r.css("transform"),
                                        s = "static" === r.css("position"),
                                        p = r.is("html");
                            return r && r.length > 0 ? r : t()
                        },
                        positions: function() {
                            return {
                                "top left": !1,
                                "top center": !1,
                                "top right": !1,
                                "bottom left": !1,
                                "bottom center": !1,
                                "bottom right": !1,
                                "left center": !1,
                                "right center": !1
                            }
                        },
                        nextPosition: function(t) {
                            var e = t.split(" ")
                                , o = e[0]
                                , n = e[1]
                                , i = {
                                    top: "bottom",
                                    bottom: "top",
                                    left: "right",
                                    right: "left"
                                }
                                , r = {
                                    left: "center",
                                    center: "right",
                                    right: "left"
                                }
                                , a = {
                                    "top left": "top center",
                                    "top center": "top right",
                                    "top right": "right center",
                                    "right center": "bottom right",
                                    "bottom right": "bottom center",
                                    "bottom center": "bottom left",
                                    "bottom left": "left center",
                                    "left center": "top left"
                                }
                                , s = "top" == o || "bottom" == o
                                , p = !1
                                , l = !1
                                , u = !1;
                            return M || (C.verbose("All available positions available"),
                                M = C.get.positions()),
                                C.debug("Recording last position tried", t),
                                M[t] = !0,
                                "opposite" === T.prefer && (u = [i[o], n],
                                u = u.join(" "),
                                p = M[u] === !0,
                                C.debug("Trying opposite strategy", u)),
                                "adjacent" === T.prefer && s && (u = [o, r[n]],
                                u = u.join(" "),
                                l = M[u] === !0,
                                C.debug("Trying adjacent strategy", u)),
                                (l || p) && (C.debug("Using backup position", u),
                                u = a[t]),
                                u
                        }
                    },
                    set: {
                        position: function(t, e) {
                            if (0 === H.length || 0 === a.length)
                                return void C.error(k.notFound);
                            var o, i, r, s, p, l, u, c;
                            if (e = e || C.get.calculations(),
                                t = t || O.data(S.position) || T.position,
                                o = O.data(S.offset) || T.offset,
                                i = T.distanceAway,
                                r = e.target,
                                s = e.popup,
                                p = e.parent,
                                0 === r.width && 0 === r.height && !C.is.svg(r.element))
                                return C.debug("Popup target is hidden, no action taken"),
                                    !1;
                            switch (T.inline && (C.debug("Adding margin to calculation", r.margin),
                                    "left center" == t || "right center" == t ? (o += r.margin.top,
                                i += -r.margin.left) : "top left" == t || "top center" == t || "top right" == t ? (o += r.margin.left,
                                i -= r.margin.top) : (o += r.margin.left,
                                i += r.margin.top)),
                                C.debug("Determining popup position from calculations", t, e),
                                C.is.rtl() && (t = t.replace(/left|right/g, function(t) {
                                return "left" == t ? "right" : "left"
                            }),
                                C.debug("RTL: Popup position updated", t)),
                                N == T.maxSearchDepth && "string" == typeof T.lastResort && (t = T.lastResort),
                                t) {
                                case "top left":
                                    l = {
                                        top: "auto",
                                        bottom: p.height - r.top + i,
                                        left: r.left + o,
                                        right: "auto"
                                    };
                                    break;
                                case "top center":
                                    l = {
                                        bottom: p.height - r.top + i,
                                        left: r.left + r.width / 2 - s.width / 2 + o,
                                        top: "auto",
                                        right: "auto"
                                    };
                                    break;
                                case "top right":
                                    l = {
                                        bottom: p.height - r.top + i,
                                        right: p.width - r.left - r.width - o,
                                        top: "auto",
                                        left: "auto"
                                    };
                                    break;
                                case "left center":
                                    l = {
                                        top: r.top + r.height / 2 - s.height / 2 + o,
                                        right: p.width - r.left + i,
                                        left: "auto",
                                        bottom: "auto"
                                    };
                                    break;
                                case "right center":
                                    l = {
                                        top: r.top + r.height / 2 - s.height / 2 + o,
                                        left: r.left + r.width + i,
                                        bottom: "auto",
                                        right: "auto"
                                    };
                                    break;
                                case "bottom left":
                                    l = {
                                        top: r.top + r.height + i,
                                        left: r.left + o,
                                        bottom: "auto",
                                        right: "auto"
                                    };
                                    break;
                                case "bottom center":
                                    l = {
                                        top: r.top + r.height + i,
                                        left: r.left + r.width / 2 - s.width / 2 + o,
                                        bottom: "auto",
                                        right: "auto"
                                    };
                                    break;
                                case "bottom right":
                                    l = {
                                        top: r.top + r.height + i,
                                        right: p.width - r.left - r.width - o,
                                        left: "auto",
                                        bottom: "auto"
                                    }
                            }
                            if (l === n && C.error(k.invalidPosition, t),
                                C.debug("Calculated popup positioning values", l),
                                a.css(l).removeClass(x.position).addClass(t).addClass(x.loading),
                                u = C.get.popupOffset(),
                                c = C.get.distanceFromBoundary(u, e),
                                C.is.offstage(c, t)) {
                                if (C.debug("Position is outside viewport", t),
                                    N < T.maxSearchDepth)
                                    return N++,
                                        t = C.get.nextPosition(t),
                                        C.debug("Trying new position", t),
                                        !!a && C.set.position(t, e);
                                if (!T.lastResort)
                                    return C.debug("Popup could not find a position to display", a),
                                        C.error(k.cannotPlace, G),
                                        C.remove.attempts(),
                                        C.remove.loading(),
                                        C.reset(),
                                        T.onUnplaceable.call(a, G),
                                        !1;
                                C.debug("No position found, showing with last position")
                            }
                            return C.debug("Position is on stage", t),
                                C.remove.attempts(),
                                C.remove.loading(),
                                T.setFluidWidth && C.is.fluid() && C.set.fluidWidth(e),
                                !0
                        },
                        fluidWidth: function(t) {
                            t = t || C.get.calculations(),
                                C.debug("Automatically setting element width to parent width", t.parent.width),
                                a.css("width", t.container.width)
                        },
                        variation: function(t) {
                            t = t || C.get.variation(),
                                t && C.has.popup() && (C.verbose("Adding variation to popup", t),
                                a.addClass(t))
                        },
                        visible: function() {
                            O.addClass(x.visible)
                        }
                    },
                    remove: {
                        loading: function() {
                            a.removeClass(x.loading)
                        },
                        variation: function(t) {
                            t = t || C.get.variation(),
                                t && (C.verbose("Removing variation", t),
                                a.removeClass(t))
                        },
                        visible: function() {
                            O.removeClass(x.visible)
                        },
                        attempts: function() {
                            C.verbose("Resetting all searched positions"),
                                N = 0,
                                M = !1
                        }
                    },
                    bind: {
                        events: function() {
                            C.debug("Binding popup events to module"),
                                "click" == T.on && O.on("click" + A, C.toggle),
                                "hover" == T.on && c && O.on("touchstart" + A, C.event.touchstart),
                                C.get.startEvent() && O.on(C.get.startEvent() + A, C.event.start).on(C.get.endEvent() + A, C.event.end),
                                T.target && C.debug("Target set to element", H),
                                p.on("resize" + w, C.event.resize)
                        },
                        popup: function() {
                            C.verbose("Allowing hover events on popup to prevent closing"),
                                a && C.has.popup() && a.on("mouseenter" + A, C.event.start).on("mouseleave" + A, C.event.end)
                        },
                        close: function() {
                            (T.hideOnScroll === !0 || "auto" == T.hideOnScroll && "click" != T.on) && F.one(C.get.scrollEvent() + w, C.event.hideGracefully),
                                "hover" == T.on && W && (C.verbose("Binding popup close event to document"),
                                s.on("touchstart" + w, function(t) {
                                    C.verbose("Touched away from popup"),
                                        C.event.hideGracefully.call(G, t)
                                })),
                                "click" == T.on && T.closable && (C.verbose("Binding popup close event to document"),
                                s.on("click" + w, function(t) {
                                    C.verbose("Clicked away from popup"),
                                        C.event.hideGracefully.call(G, t)
                                }))
                        }
                    },
                    unbind: {
                        events: function() {
                            p.off(w),
                                O.off(A)
                        },
                        close: function() {
                            s.off(w),
                                F.off(w)
                        }
                    },
                    has: {
                        popup: function() {
                            return a && a.length > 0
                        }
                    },
                    is: {
                        offstage: function(e, o) {
                            var n = [];
                            return t.each(e, function(t, e) {
                                e < -T.jitter && (C.debug("Position exceeds allowable distance from edge", t, e, o),
                                    n.push(t))
                            }),
                                n.length > 0
                        },
                        svg: function(t) {
                            return C.supports.svg() && t instanceof SVGGraphicsElement
                        },
                        active: function() {
                            return O.hasClass(x.active)
                        },
                        animating: function() {
                            return a !== n && a.hasClass(x.animating)
                        },
                        fluid: function() {
                            return a !== n && a.hasClass(x.fluid)
                        },
                        visible: function() {
                            return a !== n && a.hasClass(x.visible)
                        },
                        dropdown: function() {
                            return O.hasClass(x.dropdown)
                        },
                        hidden: function() {
                            return !C.is.visible()
                        },
                        rtl: function() {
                            return "rtl" == O.css("direction")
                        }
                    },
                    reset: function() {
                        C.remove.visible(),
                            T.preserve ? t.fn.transition !== n && a.transition("remove transition") : C.removePopup()
                    },
                    setting: function(e, o) {
                        if (t.isPlainObject(e))
                            t.extend(!0, T, e);
                        else {
                            if (o === n)
                                return T[e];
                            T[e] = o
                        }
                    },
                    internal: function(e, o) {
                        if (t.isPlainObject(e))
                            t.extend(!0, C, e);
                        else {
                            if (o === n)
                                return C[e];
                            C[e] = o
                        }
                    },
                    debug: function() {
                        !T.silent && T.debug && (T.performance ? C.performance.log(arguments) : (C.debug = Function.prototype.bind.call(console.info, console, T.name + ":"),
                            C.debug.apply(console, arguments)))
                    },
                    verbose: function() {
                        !T.silent && T.verbose && T.debug && (T.performance ? C.performance.log(arguments) : (C.verbose = Function.prototype.bind.call(console.info, console, T.name + ":"),
                            C.verbose.apply(console, arguments)))
                    },
                    error: function() {
                        T.silent || (C.error = Function.prototype.bind.call(console.error, console, T.name + ":"),
                            C.error.apply(console, arguments))
                    },
                    performance: {
                        log: function(t) {
                            var e, o, n;
                            T.performance && (e = (new Date).getTime(),
                                n = d || e,
                                o = e - n,
                                d = e,
                                f.push({
                                    Name: t[0],
                                    Arguments: [].slice.call(t, 1) || "",
                                    Element: G,
                                    "Execution Time": o
                                })),
                                clearTimeout(C.performance.timer),
                                C.performance.timer = setTimeout(C.performance.display, 500)
                        },
                        display: function() {
                            var e = T.name + ":"
                                , o = 0;
                            d = !1,
                                clearTimeout(C.performance.timer),
                                t.each(f, function(t, e) {
                                    o += e["Execution Time"]
                                }),
                                e += " " + o + "ms",
                                u && (e += " '" + u + "'"),
                                (console.group !== n || console.table !== n) && f.length > 0 && (console.groupCollapsed(e),
                                console.table ? console.table(f) : t.each(f, function(t, e) {
                                    console.log(e.Name + ": " + e["Execution Time"] + "ms")
                                }),
                                console.groupEnd()),
                                f = []
                        }
                    },
                    invoke: function(e, o, i) {
                        var a, s, p, l = I;
                        return o = o || m,
                            i = G || i,
                            "string" == typeof e && l !== n && (e = e.split(/[\. ]/),
                            a = e.length - 1,
                            t.each(e, function(o, i) {
                                var r = o != a ? i + e[o + 1].charAt(0).toUpperCase() + e[o + 1].slice(1) : e;
                                if (t.isPlainObject(l[r]) && o != a)
                                    l = l[r];
                                else {
                                    if (l[r] !== n)
                                        return s = l[r],
                                            !1;
                                    if (!t.isPlainObject(l[i]) || o == a)
                                        return l[i] !== n && (s = l[i],
                                            !1);
                                    l = l[i]
                                }
                            })),
                            t.isFunction(s) ? p = s.apply(i, o) : s !== n && (p = s),
                            t.isArray(r) ? r.push(p) : r !== n ? r = [r, p] : p !== n && (r = p),
                            s
                    }
                },
                    h ? (I === n && C.initialize(),
                        C.invoke(g)) : (I !== n && I.invoke("destroy"),
                        C.initialize())
            }),
                    r !== n ? r : this
        }
        ,
        t.fn.popup.settings = {
            name: "Popup",
            silent: !1,
            debug: !1,
            verbose: !1,
            performance: !0,
            namespace: "popup",
            observeChanges: !0,
            onCreate: function() {},
            onRemove: function() {},
            onShow: function() {},
            onVisible: function() {},
            onHide: function() {},
            onUnplaceable: function() {},
            onHidden: function() {},
            on: "hover",
            boundary: e,
            addTouchEvents: !0,
            position: "top left",
            variation: "",
            movePopup: !0,
            target: !1,
            popup: !1,
            inline: !1,
            preserve: !1,
            hoverable: !1,
            content: !1,
            html: !1,
            title: !1,
            closable: !0,
            hideOnScroll: "auto",
            exclusive: !1,
            context: "body",
            scrollContext: e,
            prefer: "opposite",
            lastResort: !1,
            delay: {
                show: 50,
                hide: 70
            },
            setFluidWidth: !0,
            duration: 200,
            transition: "scale",
            distanceAway: 0,
            jitter: 2,
            offset: 0,
            maxSearchDepth: 15,
            error: {
                invalidPosition: "The position you specified is not a valid position",
                cannotPlace: "Popup does not fit within the boundaries of the viewport",
                method: "The method you called is not defined.",
                noTransition: "This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",
                notFound: "The target or popup you specified does not exist on the page"
            },
            metadata: {
                activator: "activator",
                content: "content",
                html: "html",
                offset: "offset",
                position: "position",
                title: "title",
                variation: "variation"
            },
            className: {
                active: "active",
                animating: "animating",
                dropdown: "dropdown",
                fluid: "fluid",
                loading: "loading",
                popup: "ui popup",
                position: "top left center bottom right",
                visible: "visible"
            },
            selector: {
                popup: ".ui.popup"
            },
            templates: {
                escape: function(t) {
                    var e = /[&<>"'`]/g
                        , o = /[&<>"'`]/
                        , n = {
                            "&": "&amp;",
                            "<": "&lt;",
                            ">": "&gt;",
                            '"': "&quot;",
                            "'": "&#x27;",
                            "`": "&#x60;"
                        }
                        , i = function(t) {
                            return n[t]
                        };
                    return o.test(t) ? t.replace(e, i) : t
                },
                popup: function(e) {
                    var o = ""
                        , i = t.fn.popup.settings.templates.escape;
                    return typeof e !== n && (typeof e.title !== n && e.title && (e.title = i(e.title),
                        o += '<div class="header">' + e.title + "</div>"),
                        typeof e.content !== n && e.content && (e.content = i(e.content),
                        o += '<div class="content">' + e.content + "</div>")),
                        o
                }
            }
        }
}(jQuery, window, document);
;(function($, window, document, undefined) {
    "use strict";
    window = (typeof window != 'undefined' && window.Math == Math) ? window : (typeof self != 'undefined' && self.Math == Math) ? self : Function('return this')();
    $.fn.checkbox = function(parameters) {
        var $allModules = $(this), moduleSelector = $allModules.selector || '', time = new Date().getTime(), performance = [], query = arguments[0], methodInvoked = (typeof query == 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue;
        $allModules.each(function() {
            var settings = $.extend(true, {}, $.fn.checkbox.settings, parameters), className = settings.className, namespace = settings.namespace, selector = settings.selector, error = settings.error, eventNamespace = '.' + namespace, moduleNamespace = 'module-' + namespace, $module = $(this), $label = $(this).children(selector.label), $input = $(this).children(selector.input), input = $input[0], initialLoad = false, shortcutPressed = false, instance = $module.data(moduleNamespace), observer, element = this, module;
            module = {
                initialize: function() {
                    module.verbose('Initializing checkbox', settings);
                    module.create.label();
                    module.bind.events();
                    module.set.tabbable();
                    module.hide.input();
                    module.observeChanges();
                    module.instantiate();
                    module.setup();
                },
                instantiate: function() {
                    module.verbose('Storing instance of module', module);
                    instance = module;
                    $module.data(moduleNamespace, module);
                },
                destroy: function() {
                    module.verbose('Destroying module');
                    module.unbind.events();
                    module.show.input();
                    $module.removeData(moduleNamespace);
                },
                fix: {
                    reference: function() {
                        if ($module.is(selector.input)) {
                            module.debug('Behavior called on <input> adjusting invoked element');
                            $module = $module.closest(selector.checkbox);
                            module.refresh();
                        }
                    }
                },
                setup: function() {
                    module.set.initialLoad();
                    if (module.is.indeterminate()) {
                        module.debug('Initial value is indeterminate');
                        module.indeterminate();
                    } else if (module.is.checked()) {
                        module.debug('Initial value is checked');
                        module.check();
                    } else {
                        module.debug('Initial value is unchecked');
                        module.uncheck();
                    }
                    module.remove.initialLoad();
                },
                refresh: function() {
                    $label = $module.children(selector.label);
                    $input = $module.children(selector.input);
                    input = $input[0];
                },
                hide: {
                    input: function() {
                        module.verbose('Modifying <input> z-index to be unselectable');
                        $input.addClass(className.hidden);
                    }
                },
                show: {
                    input: function() {
                        module.verbose('Modifying <input> z-index to be selectable');
                        $input.removeClass(className.hidden);
                    }
                },
                observeChanges: function() {
                    if ('MutationObserver'in window) {
                        observer = new MutationObserver(function(mutations) {
                                module.debug('DOM tree modified, updating selector cache');
                                module.refresh();
                            }
                        );
                        observer.observe(element, {
                            childList: true,
                            subtree: true
                        });
                        module.debug('Setting up mutation observer', observer);
                    }
                },
                attachEvents: function(selector, event) {
                    var $element = $(selector);
                    event = $.isFunction(module[event]) ? module[event] : module.toggle;
                    if ($element.length > 0) {
                        module.debug('Attaching checkbox events to element', selector, event);
                        $element.on('click' + eventNamespace, event);
                    } else {
                        module.error(error.notFound);
                    }
                },
                event: {
                    click: function(event) {
                        var $target = $(event.target);
                        if ($target.is(selector.input)) {
                            module.verbose('Using default check action on initialized checkbox');
                            return;
                        }
                        if ($target.is(selector.link)) {
                            module.debug('Clicking link inside checkbox, skipping toggle');
                            return;
                        }
                        module.toggle();
                        $input.focus();
                        event.preventDefault();
                    },
                    keydown: function(event) {
                        var key = event.which
                            , keyCode = {
                                enter: 13,
                                space: 32,
                                escape: 27
                            };
                        if (key == keyCode.escape) {
                            module.verbose('Escape key pressed blurring field');
                            $input.blur();
                            shortcutPressed = true;
                        } else if (!event.ctrlKey && (key == keyCode.space || key == keyCode.enter)) {
                            module.verbose('Enter/space key pressed, toggling checkbox');
                            module.toggle();
                            shortcutPressed = true;
                        } else {
                            shortcutPressed = false;
                        }
                    },
                    keyup: function(event) {
                        if (shortcutPressed) {
                            event.preventDefault();
                        }
                    }
                },
                check: function() {
                    if (!module.should.allowCheck()) {
                        return;
                    }
                    module.debug('Checking checkbox', $input);
                    module.set.checked();
                    if (!module.should.ignoreCallbacks()) {
                        settings.onChecked.call(input);
                        settings.onChange.call(input);
                    }
                },
                uncheck: function() {
                    if (!module.should.allowUncheck()) {
                        return;
                    }
                    module.debug('Unchecking checkbox');
                    module.set.unchecked();
                    if (!module.should.ignoreCallbacks()) {
                        settings.onUnchecked.call(input);
                        settings.onChange.call(input);
                    }
                },
                indeterminate: function() {
                    if (module.should.allowIndeterminate()) {
                        module.debug('Checkbox is already indeterminate');
                        return;
                    }
                    module.debug('Making checkbox indeterminate');
                    module.set.indeterminate();
                    if (!module.should.ignoreCallbacks()) {
                        settings.onIndeterminate.call(input);
                        settings.onChange.call(input);
                    }
                },
                determinate: function() {
                    if (module.should.allowDeterminate()) {
                        module.debug('Checkbox is already determinate');
                        return;
                    }
                    module.debug('Making checkbox determinate');
                    module.set.determinate();
                    if (!module.should.ignoreCallbacks()) {
                        settings.onDeterminate.call(input);
                        settings.onChange.call(input);
                    }
                },
                enable: function() {
                    if (module.is.enabled()) {
                        module.debug('Checkbox is already enabled');
                        return;
                    }
                    module.debug('Enabling checkbox');
                    module.set.enabled();
                    settings.onEnable.call(input);
                    settings.onEnabled.call(input);
                },
                disable: function() {
                    if (module.is.disabled()) {
                        module.debug('Checkbox is already disabled');
                        return;
                    }
                    module.debug('Disabling checkbox');
                    module.set.disabled();
                    settings.onDisable.call(input);
                    settings.onDisabled.call(input);
                },
                get: {
                    radios: function() {
                        var name = module.get.name();
                        return $('input[name="' + name + '"]').closest(selector.checkbox);
                    },
                    otherRadios: function() {
                        return module.get.radios().not($module);
                    },
                    name: function() {
                        return $input.attr('name');
                    }
                },
                is: {
                    initialLoad: function() {
                        return initialLoad;
                    },
                    radio: function() {
                        return ( $input.hasClass(className.radio) || $input.attr('type') == 'radio') ;
                    },
                    indeterminate: function() {
                        return $input.prop('indeterminate') !== undefined && $input.prop('indeterminate');
                    },
                    checked: function() {
                        return $input.prop('checked') !== undefined && $input.prop('checked');
                    },
                    disabled: function() {
                        return $input.prop('disabled') !== undefined && $input.prop('disabled');
                    },
                    enabled: function() {
                        return !module.is.disabled();
                    },
                    determinate: function() {
                        return !module.is.indeterminate();
                    },
                    unchecked: function() {
                        return !module.is.checked();
                    }
                },
                should: {
                    allowCheck: function() {
                        if (module.is.determinate() && module.is.checked() && !module.should.forceCallbacks()) {
                            module.debug('Should not allow check, checkbox is already checked');
                            return false;
                        }
                        if (settings.beforeChecked.apply(input) === false) {
                            module.debug('Should not allow check, beforeChecked cancelled');
                            return false;
                        }
                        return true;
                    },
                    allowUncheck: function() {
                        if (module.is.determinate() && module.is.unchecked() && !module.should.forceCallbacks()) {
                            module.debug('Should not allow uncheck, checkbox is already unchecked');
                            return false;
                        }
                        if (settings.beforeUnchecked.apply(input) === false) {
                            module.debug('Should not allow uncheck, beforeUnchecked cancelled');
                            return false;
                        }
                        return true;
                    },
                    allowIndeterminate: function() {
                        if (module.is.indeterminate() && !module.should.forceCallbacks()) {
                            module.debug('Should not allow indeterminate, checkbox is already indeterminate');
                            return false;
                        }
                        if (settings.beforeIndeterminate.apply(input) === false) {
                            module.debug('Should not allow indeterminate, beforeIndeterminate cancelled');
                            return false;
                        }
                        return true;
                    },
                    allowDeterminate: function() {
                        if (module.is.determinate() && !module.should.forceCallbacks()) {
                            module.debug('Should not allow determinate, checkbox is already determinate');
                            return false;
                        }
                        if (settings.beforeDeterminate.apply(input) === false) {
                            module.debug('Should not allow determinate, beforeDeterminate cancelled');
                            return false;
                        }
                        return true;
                    },
                    forceCallbacks: function() {
                        return ( module.is.initialLoad() && settings.fireOnInit) ;
                    },
                    ignoreCallbacks: function() {
                        return ( initialLoad && !settings.fireOnInit) ;
                    }
                },
                can: {
                    change: function() {
                        return !($module.hasClass(className.disabled) || $module.hasClass(className.readOnly) || $input.prop('disabled') || $input.prop('readonly'));
                    },
                    uncheck: function() {
                        return (typeof settings.uncheckable === 'boolean') ? settings.uncheckable : !module.is.radio();
                    }
                },
                set: {
                    initialLoad: function() {
                        initialLoad = true;
                    },
                    checked: function() {
                        module.verbose('Setting class to checked');
                        $module.removeClass(className.indeterminate).addClass(className.checked);
                        if (module.is.radio()) {
                            module.uncheckOthers();
                        }
                        if (!module.is.indeterminate() && module.is.checked()) {
                            module.debug('Input is already checked, skipping input property change');
                            return;
                        }
                        module.verbose('Setting state to checked', input);
                        $input.prop('indeterminate', false).prop('checked', true);
                        module.trigger.change();
                    },
                    unchecked: function() {
                        module.verbose('Removing checked class');
                        $module.removeClass(className.indeterminate).removeClass(className.checked);
                        if (!module.is.indeterminate() && module.is.unchecked()) {
                            module.debug('Input is already unchecked');
                            return;
                        }
                        module.debug('Setting state to unchecked');
                        $input.prop('indeterminate', false).prop('checked', false);
                        module.trigger.change();
                    },
                    indeterminate: function() {
                        module.verbose('Setting class to indeterminate');
                        $module.addClass(className.indeterminate);
                        if (module.is.indeterminate()) {
                            module.debug('Input is already indeterminate, skipping input property change');
                            return;
                        }
                        module.debug('Setting state to indeterminate');
                        $input.prop('indeterminate', true);
                        module.trigger.change();
                    },
                    determinate: function() {
                        module.verbose('Removing indeterminate class');
                        $module.removeClass(className.indeterminate);
                        if (module.is.determinate()) {
                            module.debug('Input is already determinate, skipping input property change');
                            return;
                        }
                        module.debug('Setting state to determinate');
                        $input.prop('indeterminate', false);
                    },
                    disabled: function() {
                        module.verbose('Setting class to disabled');
                        $module.addClass(className.disabled);
                        if (module.is.disabled()) {
                            module.debug('Input is already disabled, skipping input property change');
                            return;
                        }
                        module.debug('Setting state to disabled');
                        $input.prop('disabled', 'disabled');
                        module.trigger.change();
                    },
                    enabled: function() {
                        module.verbose('Removing disabled class');
                        $module.removeClass(className.disabled);
                        if (module.is.enabled()) {
                            module.debug('Input is already enabled, skipping input property change');
                            return;
                        }
                        module.debug('Setting state to enabled');
                        $input.prop('disabled', false);
                        module.trigger.change();
                    },
                    tabbable: function() {
                        module.verbose('Adding tabindex to checkbox');
                        if ($input.attr('tabindex') === undefined) {
                            $input.attr('tabindex', 0);
                        }
                    }
                },
                remove: {
                    initialLoad: function() {
                        initialLoad = false;
                    }
                },
                trigger: {
                    change: function() {
                        var events = document.createEvent('HTMLEvents')
                            , inputElement = $input[0];
                        if (inputElement) {
                            module.verbose('Triggering native change event');
                            events.initEvent('change', true, false);
                            inputElement.dispatchEvent(events);
                        }
                    }
                },
                create: {
                    label: function() {
                        if ($input.prevAll(selector.label).length > 0) {
                            $input.prev(selector.label).detach().insertAfter($input);
                            module.debug('Moving existing label', $label);
                        } else if (!module.has.label()) {
                            $label = $('<label>').insertAfter($input);
                            module.debug('Creating label', $label);
                        }
                    }
                },
                has: {
                    label: function() {
                        return ( $label.length > 0) ;
                    }
                },
                bind: {
                    events: function() {
                        module.verbose('Attaching checkbox events');
                        $module.on('click' + eventNamespace, module.event.click).on('keydown' + eventNamespace, selector.input, module.event.keydown).on('keyup' + eventNamespace, selector.input, module.event.keyup);
                    }
                },
                unbind: {
                    events: function() {
                        module.debug('Removing events');
                        $module.off(eventNamespace);
                    }
                },
                uncheckOthers: function() {
                    var $radios = module.get.otherRadios();
                    module.debug('Unchecking other radios', $radios);
                    $radios.removeClass(className.checked);
                },
                toggle: function() {
                    if (!module.can.change()) {
                        if (!module.is.radio()) {
                            module.debug('Checkbox is read-only or disabled, ignoring toggle');
                        }
                        return;
                    }
                    if (module.is.indeterminate() || module.is.unchecked()) {
                        module.debug('Currently unchecked');
                        module.check();
                    } else if (module.is.checked() && module.can.uncheck()) {
                        module.debug('Currently checked');
                        module.uncheck();
                    }
                },
                setting: function(name, value) {
                    module.debug('Changing setting', name, value);
                    if ($.isPlainObject(name)) {
                        $.extend(true, settings, name);
                    } else if (value !== undefined) {
                        if ($.isPlainObject(settings[name])) {
                            $.extend(true, settings[name], value);
                        } else {
                            settings[name] = value;
                        }
                    } else {
                        return settings[name];
                    }
                },
                internal: function(name, value) {
                    if ($.isPlainObject(name)) {
                        $.extend(true, module, name);
                    } else if (value !== undefined) {
                        module[name] = value;
                    } else {
                        return module[name];
                    }
                },
                debug: function() {
                    if (!settings.silent && settings.debug) {
                        if (settings.performance) {
                            module.performance.log(arguments);
                        } else {
                            module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
                            module.debug.apply(console, arguments);
                        }
                    }
                },
                verbose: function() {
                    if (!settings.silent && settings.verbose && settings.debug) {
                        if (settings.performance) {
                            module.performance.log(arguments);
                        } else {
                            module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
                            module.verbose.apply(console, arguments);
                        }
                    }
                },
                error: function() {
                    if (!settings.silent) {
                        module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
                        module.error.apply(console, arguments);
                    }
                },
                performance: {
                    log: function(message) {
                        var currentTime, executionTime, previousTime;
                        if (settings.performance) {
                            currentTime = new Date().getTime();
                            previousTime = time || currentTime;
                            executionTime = currentTime - previousTime;
                            time = currentTime;
                            performance.push({
                                'Name': message[0],
                                'Arguments': [].slice.call(message, 1) || '',
                                'Element': element,
                                'Execution Time': executionTime
                            });
                        }
                        clearTimeout(module.performance.timer);
                        module.performance.timer = setTimeout(module.performance.display, 500);
                    },
                    display: function() {
                        var title = settings.name + ':'
                            , totalTime = 0;
                        time = false;
                        clearTimeout(module.performance.timer);
                        $.each(performance, function(index, data) {
                            totalTime += data['Execution Time'];
                        });
                        title += ' ' + totalTime + 'ms';
                        if (moduleSelector) {
                            title += ' \'' + moduleSelector + '\'';
                        }
                        if ((console.group !== undefined || console.table !== undefined) && performance.length > 0) {
                            console.groupCollapsed(title);
                            if (console.table) {
                                console.table(performance);
                            } else {
                                $.each(performance, function(index, data) {
                                    console.log(data['Name'] + ': ' + data['Execution Time'] + 'ms');
                                });
                            }
                            console.groupEnd();
                        }
                        performance = [];
                    }
                },
                invoke: function(query, passedArguments, context) {
                    var object = instance, maxDepth, found, response;
                    passedArguments = passedArguments || queryArguments;
                    context = element || context;
                    if (typeof query == 'string' && object !== undefined) {
                        query = query.split(/[\. ]/);
                        maxDepth = query.length - 1;
                        $.each(query, function(depth, value) {
                            var camelCaseValue = (depth != maxDepth) ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) : query;
                            if ($.isPlainObject(object[camelCaseValue]) && (depth != maxDepth)) {
                                object = object[camelCaseValue];
                            } else if (object[camelCaseValue] !== undefined) {
                                found = object[camelCaseValue];
                                return false;
                            } else if ($.isPlainObject(object[value]) && (depth != maxDepth)) {
                                object = object[value];
                            } else if (object[value] !== undefined) {
                                found = object[value];
                                return false;
                            } else {
                                module.error(error.method, query);
                                return false;
                            }
                        });
                    }
                    if ($.isFunction(found)) {
                        response = found.apply(context, passedArguments);
                    } else if (found !== undefined) {
                        response = found;
                    }
                    if ($.isArray(returnedValue)) {
                        returnedValue.push(response);
                    } else if (returnedValue !== undefined) {
                        returnedValue = [returnedValue, response];
                    } else if (response !== undefined) {
                        returnedValue = response;
                    }
                    return found;
                }
            };
            if (methodInvoked) {
                if (instance === undefined) {
                    module.initialize();
                }
                module.invoke(query);
            } else {
                if (instance !== undefined) {
                    instance.invoke('destroy');
                }
                module.initialize();
            }
        });
        return (returnedValue !== undefined) ? returnedValue : this;
    }
    ;
    $.fn.checkbox.settings = {
        name: 'Checkbox',
        namespace: 'checkbox',
        silent: false,
        debug: false,
        verbose: true,
        performance: true,
        uncheckable: 'auto',
        fireOnInit: false,
        onChange: function() {},
        beforeChecked: function() {},
        beforeUnchecked: function() {},
        beforeDeterminate: function() {},
        beforeIndeterminate: function() {},
        onChecked: function() {},
        onUnchecked: function() {},
        onDeterminate: function() {},
        onIndeterminate: function() {},
        onEnable: function() {},
        onDisable: function() {},
        onEnabled: function() {},
        onDisabled: function() {},
        className: {
            checked: 'checked',
            indeterminate: 'indeterminate',
            disabled: 'disabled',
            hidden: 'hidden',
            radio: 'radio',
            readOnly: 'read-only'
        },
        error: {
            method: 'The method you called is not defined'
        },
        selector: {
            checkbox: '.ui.checkbox',
            label: 'label, .box',
            input: 'input[type="checkbox"], input[type="radio"]',
            link: 'a[href]'
        }
    };
})(jQuery, window, document);
!function(e, t) {
    "use strict";
    function n(e, t) {
        for (var n, i = [], r = 0; r < e.length; ++r) {
            if (n = s[e[r]] || o(e[r]),
                !n)
                throw "module definition dependecy not found: " + e[r];
            i.push(n)
        }
        t.apply(null, i)
    }
    function i(e, i, r) {
        if ("string" != typeof e)
            throw "invalid module definition, module id must be defined and be a string";
        if (i === t)
            throw "invalid module definition, dependencies must be specified";
        if (r === t)
            throw "invalid module definition, definition function must be specified";
        n(i, function() {
            s[e] = r.apply(null, arguments)
        })
    }
    function r(e) {
        return !!s[e]
    }
    function o(t) {
        for (var n = e, i = t.split(/[.\/]/), r = 0; r < i.length; ++r) {
            if (!n[i[r]])
                return;
            n = n[i[r]]
        }
        return n
    }
    function a(n) {
        for (var i = 0; i < n.length; i++) {
            for (var r = e, o = n[i], a = o.split(/[.\/]/), u = 0; u < a.length - 1; ++u)
                r[a[u]] === t && (r[a[u]] = {}),
                    r = r[a[u]];
            r[a[a.length - 1]] = s[o]
        }
    }
    var s = {}
        , u = "moxie/core/utils/Basic"
        , c = "moxie/core/I18n"
        , l = "moxie/core/utils/Mime"
        , d = "moxie/core/utils/Env"
        , f = "moxie/core/utils/Dom"
        , h = "moxie/core/Exceptions"
        , p = "moxie/core/EventTarget"
        , m = "moxie/core/utils/Encode"
        , g = "moxie/runtime/Runtime"
        , v = "moxie/runtime/RuntimeClient"
        , y = "moxie/file/Blob"
        , w = "moxie/file/File"
        , E = "moxie/file/FileInput"
        , _ = "moxie/file/FileDrop"
        , x = "moxie/runtime/RuntimeTarget"
        , b = "moxie/file/FileReader"
        , R = "moxie/core/utils/Url"
        , T = "moxie/file/FileReaderSync"
        , A = "moxie/xhr/FormData"
        , S = "moxie/xhr/XMLHttpRequest"
        , O = "moxie/runtime/Transporter"
        , I = "moxie/image/Image"
        , D = "moxie/runtime/html5/Runtime"
        , N = "moxie/runtime/html5/file/Blob"
        , L = "moxie/core/utils/Events"
        , M = "moxie/runtime/html5/file/FileInput"
        , C = "moxie/runtime/html5/file/FileDrop"
        , F = "moxie/runtime/html5/file/FileReader"
        , H = "moxie/runtime/html5/xhr/XMLHttpRequest"
        , P = "moxie/runtime/html5/utils/BinaryReader"
        , k = "moxie/runtime/html5/image/JPEGHeaders"
        , U = "moxie/runtime/html5/image/ExifParser"
        , B = "moxie/runtime/html5/image/JPEG"
        , z = "moxie/runtime/html5/image/PNG"
        , G = "moxie/runtime/html5/image/ImageInfo"
        , q = "moxie/runtime/html5/image/MegaPixel"
        , X = "moxie/runtime/html5/image/Image"
        , j = "moxie/runtime/flash/Runtime"
        , V = "moxie/runtime/flash/file/Blob"
        , W = "moxie/runtime/flash/file/FileInput"
        , Y = "moxie/runtime/flash/file/FileReader"
        , $ = "moxie/runtime/flash/file/FileReaderSync"
        , J = "moxie/runtime/flash/xhr/XMLHttpRequest"
        , Z = "moxie/runtime/flash/runtime/Transporter"
        , K = "moxie/runtime/flash/image/Image"
        , Q = "moxie/runtime/silverlight/Runtime"
        , et = "moxie/runtime/silverlight/file/Blob"
        , tt = "moxie/runtime/silverlight/file/FileInput"
        , nt = "moxie/runtime/silverlight/file/FileDrop"
        , it = "moxie/runtime/silverlight/file/FileReader"
        , rt = "moxie/runtime/silverlight/file/FileReaderSync"
        , ot = "moxie/runtime/silverlight/xhr/XMLHttpRequest"
        , at = "moxie/runtime/silverlight/runtime/Transporter"
        , st = "moxie/runtime/silverlight/image/Image"
        , ut = "moxie/runtime/html4/Runtime"
        , ct = "moxie/runtime/html4/file/FileInput"
        , lt = "moxie/runtime/html4/file/FileReader"
        , dt = "moxie/runtime/html4/xhr/XMLHttpRequest"
        , ft = "moxie/runtime/html4/image/Image";
    i(u, [], function() {
        var e = function(e) {
                var t;
                return e === t ? "undefined" : null === e ? "null" : e.nodeType ? "node" : {}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()
            }
            , t = function(i) {
                var r;
                return n(arguments, function(o, s) {
                    s > 0 && n(o, function(n, o) {
                        n !== r && (e(i[o]) === e(n) && ~a(e(n), ["array", "object"]) ? t(i[o], n) : i[o] = n)
                    })
                }),
                    i
            }
            , n = function(e, t) {
                var n, i, r, o;
                if (e) {
                    try {
                        n = e.length
                    } catch (a) {
                        n = o
                    }
                    if (n === o) {
                        for (i in e)
                            if (e.hasOwnProperty(i) && t(e[i], i) === !1)
                                return
                    } else
                        for (r = 0; n > r; r++)
                            if (t(e[r], r) === !1)
                                return
                }
            }
            , i = function(t) {
                var n;
                if (!t || "object" !== e(t))
                    return !0;
                for (n in t)
                    return !1;
                return !0
            }
            , r = function(t, n) {
                function i(r) {
                    "function" === e(t[r]) && t[r](function(e) {
                        ++r < o && !e ? i(r) : n(e)
                    })
                }
                var r = 0
                    , o = t.length;
                "function" !== e(n) && (n = function() {}
                    ),
                    t && t.length || n(),
                    i(r)
            }
            , o = function(e, t) {
                var i = 0
                    , r = e.length
                    , o = new Array(r);
                n(e, function(e, n) {
                    e(function(e) {
                        if (e)
                            return t(e);
                        var a = [].slice.call(arguments);
                        a.shift(),
                            o[n] = a,
                            i++,
                            i === r && (o.unshift(null),
                            t.apply(this, o))
                    })
                })
            }
            , a = function(e, t) {
                if (t) {
                    if (Array.prototype.indexOf)
                        return Array.prototype.indexOf.call(t, e);
                    for (var n = 0, i = t.length; i > n; n++)
                        if (t[n] === e)
                            return n
                }
                return -1
            }
            , s = function(t, n) {
                var i = [];
                "array" !== e(t) && (t = [t]),
                    "array" !== e(n) && (n = [n]);
                for (var r in t)
                    -1 === a(t[r], n) && i.push(t[r]);
                return i.length ? i : !1
            }
            , u = function(e, t) {
                var i = [];
                return n(e, function(e) {
                    -1 !== a(e, t) && i.push(e)
                }),
                    i.length ? i : null
            }
            , c = function(e) {
                var t, n = [];
                for (t = 0; t < e.length; t++)
                    n[t] = e[t];
                return n
            }
            , l = function() {
                var e = 0;
                return function(t) {
                    var n = (new Date).getTime().toString(32), i;
                    for (i = 0; 5 > i; i++)
                        n += Math.floor(65535 * Math.random()).toString(32);
                    return (t || "o_") + n + (e++).toString(32)
                }
            }()
            , d = function(e) {
                return e ? String.prototype.trim ? String.prototype.trim.call(e) : e.toString().replace(/^\s*/, "").replace(/\s*$/, "") : e
            }
            , f = function(e) {
                if ("string" != typeof e)
                    return e;
                var t = {
                    t: 1099511627776,
                    g: 1073741824,
                    m: 1048576,
                    k: 1024
                }, n;
                return e = /^([0-9]+)([mgk]?)$/.exec(e.toLowerCase().replace(/[^0-9mkg]/g, "")),
                    n = e[2],
                    e = +e[1],
                    t.hasOwnProperty(n) && (e *= t[n]),
                    e
            };
        return {
            guid: l,
            typeOf: e,
            extend: t,
            each: n,
            isEmptyObj: i,
            inSeries: r,
            inParallel: o,
            inArray: a,
            arrayDiff: s,
            arrayIntersect: u,
            toArray: c,
            trim: d,
            parseSizeStr: f
        }
    }),
        i(c, [u], function(e) {
            var t = {};
            return {
                addI18n: function(n) {
                    return e.extend(t, n)
                },
                translate: function(e) {
                    return t[e] || e
                },
                _: function(e) {
                    return this.translate(e)
                },
                sprintf: function(t) {
                    var n = [].slice.call(arguments, 1);
                    return t.replace(/%[a-z]/g, function() {
                        var t = n.shift();
                        return "undefined" !== e.typeOf(t) ? t : ""
                    })
                }
            }
        }),
        i(l, [u, c], function(e, t) {
            var n = "application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe"
                , i = {
                    mimes: {},
                    extensions: {},
                    addMimeType: function(e) {
                        var t = e.split(/,/), n, i, r;
                        for (n = 0; n < t.length; n += 2) {
                            for (r = t[n + 1].split(/ /),
                                     i = 0; i < r.length; i++)
                                this.mimes[r[i]] = t[n];
                            this.extensions[t[n]] = r
                        }
                    },
                    extList2mimes: function(t, n) {
                        var i = this, r, o, a, s, u = [];
                        for (o = 0; o < t.length; o++)
                            for (r = t[o].extensions.split(/\s*,\s*/),
                                     a = 0; a < r.length; a++) {
                                if ("*" === r[a])
                                    return [];
                                if (s = i.mimes[r[a]])
                                    -1 === e.inArray(s, u) && u.push(s);
                                else {
                                    if (!n || !/^\w+$/.test(r[a]))
                                        return [];
                                    u.push("." + r[a])
                                }
                            }
                        return u
                    },
                    mimes2exts: function(t) {
                        var n = this
                            , i = [];
                        return e.each(t, function(t) {
                            if ("*" === t)
                                return i = [],
                                    !1;
                            var r = t.match(/^(\w+)\/(\*|\w+)$/);
                            r && ("*" === r[2] ? e.each(n.extensions, function(e, t) {
                                new RegExp("^" + r[1] + "/").test(t) && [].push.apply(i, n.extensions[t])
                            }) : n.extensions[t] && [].push.apply(i, n.extensions[t]))
                        }),
                            i
                    },
                    mimes2extList: function(n) {
                        var i = []
                            , r = [];
                        return "string" === e.typeOf(n) && (n = e.trim(n).split(/\s*,\s*/)),
                            r = this.mimes2exts(n),
                            i.push({
                                title: t.translate("Files"),
                                extensions: r.length ? r.join(",") : "*"
                            }),
                            i.mimes = n,
                            i
                    },
                    getFileExtension: function(e) {
                        var t = e && e.match(/\.([^.]+)$/);
                        return t ? t[1].toLowerCase() : ""
                    },
                    getFileMime: function(e) {
                        return this.mimes[this.getFileExtension(e)] || ""
                    }
                };
            return i.addMimeType(n),
                i
        }),
        i(d, [u], function(e) {
            function t(e, t, n) {
                var i = 0
                    , r = 0
                    , o = 0
                    , a = {
                        dev: -6,
                        alpha: -5,
                        a: -5,
                        beta: -4,
                        b: -4,
                        RC: -3,
                        rc: -3,
                        "#": -2,
                        p: 1,
                        pl: 1
                    }
                    , s = function(e) {
                        return e = ("" + e).replace(/[_\-+]/g, "."),
                            e = e.replace(/([^.\d]+)/g, ".$1.").replace(/\.{2,}/g, "."),
                            e.length ? e.split(".") : [-8]
                    }
                    , u = function(e) {
                        return e ? isNaN(e) ? a[e] || -7 : parseInt(e, 10) : 0
                    };
                for (e = s(e),
                         t = s(t),
                         r = Math.max(e.length, t.length),
                         i = 0; r > i; i++)
                    if (e[i] != t[i]) {
                        if (e[i] = u(e[i]),
                            t[i] = u(t[i]),
                            e[i] < t[i]) {
                            o = -1;
                            break
                        }
                        if (e[i] > t[i]) {
                            o = 1;
                            break
                        }
                    }
                if (!n)
                    return o;
                switch (n) {
                    case ">":
                    case "gt":
                        return o > 0;
                    case ">=":
                    case "ge":
                        return o >= 0;
                    case "<=":
                    case "le":
                        return 0 >= o;
                    case "==":
                    case "=":
                    case "eq":
                        return 0 === o;
                    case "<>":
                    case "!=":
                    case "ne":
                        return 0 !== o;
                    case "":
                    case "<":
                    case "lt":
                        return 0 > o;
                    default:
                        return null
                }
            }
            var n = function(e) {
                    var t = ""
                        , n = "?"
                        , i = "function"
                        , r = "undefined"
                        , o = "object"
                        , a = "major"
                        , s = "model"
                        , u = "name"
                        , c = "type"
                        , l = "vendor"
                        , d = "version"
                        , f = "architecture"
                        , h = "console"
                        , p = "mobile"
                        , m = "tablet"
                        , g = {
                            has: function(e, t) {
                                return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
                            },
                            lowerize: function(e) {
                                return e.toLowerCase()
                            }
                        }
                        , v = {
                            rgx: function() {
                                for (var t, n = 0, a, s, u, c, l, d, f = arguments; n < f.length; n += 2) {
                                    var h = f[n]
                                        , p = f[n + 1];
                                    if (typeof t === r) {
                                        t = {};
                                        for (u in p)
                                            c = p[u],
                                                    typeof c === o ? t[c[0]] = e : t[c] = e
                                    }
                                    for (a = s = 0; a < h.length; a++)
                                        if (l = h[a].exec(this.getUA())) {
                                            for (u = 0; u < p.length; u++)
                                                d = l[++s],
                                                    c = p[u],
                                                        typeof c === o && c.length > 0 ? 2 == c.length ? t[c[0]] = typeof c[1] == i ? c[1].call(this, d) : c[1] : 3 == c.length ? t[c[0]] = typeof c[1] !== i || c[1].exec && c[1].test ? d ? d.replace(c[1], c[2]) : e : d ? c[1].call(this, d, c[2]) : e : 4 == c.length && (t[c[0]] = d ? c[3].call(this, d.replace(c[1], c[2])) : e) : t[c] = d ? d : e;
                                            break
                                        }
                                    if (l)
                                        break
                                }
                                return t
                            },
                            str: function(t, i) {
                                for (var r in i)
                                    if (typeof i[r] === o && i[r].length > 0) {
                                        for (var a = 0; a < i[r].length; a++)
                                            if (g.has(i[r][a], t))
                                                return r === n ? e : r
                                    } else if (g.has(i[r], t))
                                        return r === n ? e : r;
                                return t
                            }
                        }
                        , y = {
                            browser: {
                                oldsafari: {
                                    major: {
                                        1: ["/8", "/1", "/3"],
                                        2: "/4",
                                        "?": "/"
                                    },
                                    version: {
                                        "1.0": "/8",
                                        1.2: "/1",
                                        1.3: "/3",
                                        "2.0": "/412",
                                        "2.0.2": "/416",
                                        "2.0.3": "/417",
                                        "2.0.4": "/419",
                                        "?": "/"
                                    }
                                }
                            },
                            device: {
                                sprint: {
                                    model: {
                                        "Evo Shift 4G": "7373KT"
                                    },
                                    vendor: {
                                        HTC: "APA",
                                        Sprint: "Sprint"
                                    }
                                }
                            },
                            os: {
                                windows: {
                                    version: {
                                        ME: "4.90",
                                        "NT 3.11": "NT3.51",
                                        "NT 4.0": "NT4.0",
                                        2000: "NT 5.0",
                                        XP: ["NT 5.1", "NT 5.2"],
                                        Vista: "NT 6.0",
                                        7: "NT 6.1",
                                        8: "NT 6.2",
                                        8.1: "NT 6.3",
                                        RT: "ARM"
                                    }
                                }
                            }
                        }
                        , w = {
                            browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [u, d, a], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[u, "Opera"], d, a], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [u, d, a], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[u, "IE"], d, a], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[u, "Yandex"], d, a], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[u, /_/g, " "], d, a], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [u, d, a], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[u, "Dolphin"], d, a], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[u, "Chrome"], d, a], [/((?:android.+))version\/((\d+)?[\w\.]+)\smobile\ssafari/i], [[u, "Android Browser"], d, a], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [d, a, [u, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [d, a, u], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [u, [a, v.str, y.browser.oldsafari.major], [d, v.str, y.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [u, d, a], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[u, "Netscape"], d, a], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [u, d, a]],
                            engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [u, d], [/rv\:([\w\.]+).*(gecko)/i], [d, u]],
                            os: [[/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [u, [d, v.str, y.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[u, "Windows"], [d, v.str, y.os.windows.version]], [/\((bb)(10);/i], [[u, "BlackBerry"], d], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [u, d], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[u, "Symbian"], d], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[u, "Firefox OS"], d], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [u, d], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[u, "Chromium OS"], d], [/(sunos)\s?([\w\.]+\d)*/i], [[u, "Solaris"], d], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [u, d], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[u, "iOS"], [d, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [u, [d, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [u, d]]
                        }
                        , E = function(e) {
                            var n = e || (window && window.navigator && window.navigator.userAgent ? window.navigator.userAgent : t);
                            this.getBrowser = function() {
                                return v.rgx.apply(this, w.browser)
                            }
                                ,
                                this.getEngine = function() {
                                    return v.rgx.apply(this, w.engine)
                                }
                                ,
                                this.getOS = function() {
                                    return v.rgx.apply(this, w.os)
                                }
                                ,
                                this.getResult = function() {
                                    return {
                                        ua: this.getUA(),
                                        browser: this.getBrowser(),
                                        engine: this.getEngine(),
                                        os: this.getOS()
                                    }
                                }
                                ,
                                this.getUA = function() {
                                    return n
                                }
                                ,
                                this.setUA = function(e) {
                                    return n = e,
                                        this
                                }
                                ,
                                this.setUA(n)
                        };
                    return (new E).getResult()
                }()
                , i = function() {
                    var t = {
                        define_property: function() {
                            return !1
                        }(),
                        create_canvas: function() {
                            var e = document.createElement("canvas");
                            return !(!e.getContext || !e.getContext("2d"))
                        }(),
                        return_response_type: function(t) {
                            try {
                                if (-1 !== e.inArray(t, ["", "text", "document"]))
                                    return !0;
                                if (window.XMLHttpRequest) {
                                    var n = new XMLHttpRequest;
                                    if (n.open("get", "/"),
                                        "responseType"in n)
                                        return n.responseType = t,
                                                n.responseType !== t ? !1 : !0
                                }
                            } catch (i) {}
                            return !1
                        },
                        use_data_uri: function() {
                            var e = new Image;
                            return e.onload = function() {
                                t.use_data_uri = 1 === e.width && 1 === e.height
                            }
                                ,
                                setTimeout(function() {
                                    e.src = ""
                                }, 1),
                                !1
                        }(),
                        use_data_uri_over32kb: function() {
                            return t.use_data_uri && ("IE" !== r.browser || r.version >= 9)
                        },
                        use_data_uri_of: function(e) {
                            return t.use_data_uri && 33e3 > e || t.use_data_uri_over32kb()
                        },
                        use_fileinput: function() {
                            var e = document.createElement("input");
                            return e.setAttribute("type", "file"),
                                !e.disabled
                        }
                    };
                    return function(n) {
                        var i = [].slice.call(arguments);
                        return i.shift(),
                                "function" === e.typeOf(t[n]) ? t[n].apply(this, i) : !!t[n]
                    }
                }()
                , r = {
                    can: i,
                    browser: n.browser.name,
                    version: parseFloat(n.browser.major),
                    os: n.os.name,
                    osVersion: n.os.version,
                    verComp: t,
                    swf_url: "../flash/Moxie.swf",
                    xap_url: "../silverlight/Moxie.xap",
                    global_event_dispatcher: "moxie.core.EventTarget.instance.dispatchEvent"
                };
            return r.OS = r.os,
                r
        }),
        i(f, [d], function(e) {
            var t = function(e) {
                    return "string" != typeof e ? e : document.getElementById(e)
                }
                , n = function(e, t) {
                    if (!e.className)
                        return !1;
                    var n = new RegExp("(^|\\s+)" + t + "(\\s+|$)");
                    return n.test(e.className)
                }
                , i = function(e, t) {
                    n(e, t) || (e.className = e.className ? e.className.replace(/\s+$/, "") + " " + t : t)
                }
                , r = function(e, t) {
                    if (e.className) {
                        var n = new RegExp("(^|\\s+)" + t + "(\\s+|$)");
                        e.className = e.className.replace(n, function(e, t, n) {
                            return " " === t && " " === n ? " " : ""
                        })
                    }
                }
                , o = function(e, t) {
                    return e.currentStyle ? e.currentStyle[t] : window.getComputedStyle ? window.getComputedStyle(e, null)[t] : void 0
                }
                , a = function(t, n) {
                    function i(e) {
                        var t, n, i = 0, r = 0;
                        return e && (n = e.getBoundingClientRect(),
                            t = "CSS1Compat" === s.compatMode ? s.documentElement : s.body,
                            i = n.left + t.scrollLeft,
                            r = n.top + t.scrollTop),
                        {
                            x: i,
                            y: r
                        }
                    }
                    var r = 0, o = 0, a, s = document, u, c;
                    if (t = t,
                        n = n || s.body,
                        t && t.getBoundingClientRect && "IE" === e.browser && (!s.documentMode || s.documentMode < 8))
                        return u = i(t),
                            c = i(n),
                        {
                            x: u.x - c.x,
                            y: u.y - c.y
                        };
                    for (a = t; a && a != n && a.nodeType; )
                        r += a.offsetLeft || 0,
                            o += a.offsetTop || 0,
                            a = a.offsetParent;
                    for (a = t.parentNode; a && a != n && a.nodeType; )
                        r -= a.scrollLeft || 0,
                            o -= a.scrollTop || 0,
                            a = a.parentNode;
                    return {
                        x: r,
                        y: o
                    }
                }
                , s = function(e) {
                    return {
                        w: e.offsetWidth || e.clientWidth,
                        h: e.offsetHeight || e.clientHeight
                    }
                };
            return {
                get: t,
                hasClass: n,
                addClass: i,
                removeClass: r,
                getStyle: o,
                getPos: a,
                getSize: s
            }
        }),
        i(h, [u], function(e) {
            function t(e, t) {
                var n;
                for (n in e)
                    if (e[n] === t)
                        return n;
                return null
            }
            return {
                RuntimeError: function() {
                    function n(e) {
                        this.code = e,
                            this.name = t(i, e),
                            this.message = this.name + ": RuntimeError " + this.code
                    }
                    var i = {
                        NOT_INIT_ERR: 1,
                        NOT_SUPPORTED_ERR: 9,
                        JS_ERR: 4
                    };
                    return e.extend(n, i),
                        n.prototype = Error.prototype,
                        n
                }(),
                OperationNotAllowedException: function() {
                    function t(e) {
                        this.code = e,
                            this.name = "OperationNotAllowedException"
                    }
                    return e.extend(t, {
                        NOT_ALLOWED_ERR: 1
                    }),
                        t.prototype = Error.prototype,
                        t
                }(),
                ImageError: function() {
                    function n(e) {
                        this.code = e,
                            this.name = t(i, e),
                            this.message = this.name + ": ImageError " + this.code
                    }
                    var i = {
                        WRONG_FORMAT: 1,
                        MAX_RESOLUTION_ERR: 2
                    };
                    return e.extend(n, i),
                        n.prototype = Error.prototype,
                        n
                }(),
                FileException: function() {
                    function n(e) {
                        this.code = e,
                            this.name = t(i, e),
                            this.message = this.name + ": FileException " + this.code
                    }
                    var i = {
                        NOT_FOUND_ERR: 1,
                        SECURITY_ERR: 2,
                        ABORT_ERR: 3,
                        NOT_READABLE_ERR: 4,
                        ENCODING_ERR: 5,
                        NO_MODIFICATION_ALLOWED_ERR: 6,
                        INVALID_STATE_ERR: 7,
                        SYNTAX_ERR: 8
                    };
                    return e.extend(n, i),
                        n.prototype = Error.prototype,
                        n
                }(),
                DOMException: function() {
                    function n(e) {
                        this.code = e,
                            this.name = t(i, e),
                            this.message = this.name + ": DOMException " + this.code
                    }
                    var i = {
                        INDEX_SIZE_ERR: 1,
                        DOMSTRING_SIZE_ERR: 2,
                        HIERARCHY_REQUEST_ERR: 3,
                        WRONG_DOCUMENT_ERR: 4,
                        INVALID_CHARACTER_ERR: 5,
                        NO_DATA_ALLOWED_ERR: 6,
                        NO_MODIFICATION_ALLOWED_ERR: 7,
                        NOT_FOUND_ERR: 8,
                        NOT_SUPPORTED_ERR: 9,
                        INUSE_ATTRIBUTE_ERR: 10,
                        INVALID_STATE_ERR: 11,
                        SYNTAX_ERR: 12,
                        INVALID_MODIFICATION_ERR: 13,
                        NAMESPACE_ERR: 14,
                        INVALID_ACCESS_ERR: 15,
                        VALIDATION_ERR: 16,
                        TYPE_MISMATCH_ERR: 17,
                        SECURITY_ERR: 18,
                        NETWORK_ERR: 19,
                        ABORT_ERR: 20,
                        URL_MISMATCH_ERR: 21,
                        QUOTA_EXCEEDED_ERR: 22,
                        TIMEOUT_ERR: 23,
                        INVALID_NODE_TYPE_ERR: 24,
                        DATA_CLONE_ERR: 25
                    };
                    return e.extend(n, i),
                        n.prototype = Error.prototype,
                        n
                }(),
                EventException: function() {
                    function t(e) {
                        this.code = e,
                            this.name = "EventException"
                    }
                    return e.extend(t, {
                        UNSPECIFIED_EVENT_TYPE_ERR: 0
                    }),
                        t.prototype = Error.prototype,
                        t
                }()
            }
        }),
        i(p, [h, u], function(e, t) {
            function n() {
                var n = {};
                t.extend(this, {
                    uid: null,
                    init: function() {
                        this.uid || (this.uid = t.guid("uid_"))
                    },
                    addEventListener: function(e, i, r, o) {
                        var a = this, s;
                        return e = t.trim(e),
                            /\s/.test(e) ? void t.each(e.split(/\s+/), function(e) {
                                a.addEventListener(e, i, r, o)
                            }) : (e = e.toLowerCase(),
                                r = parseInt(r, 10) || 0,
                                s = n[this.uid] && n[this.uid][e] || [],
                                s.push({
                                    fn: i,
                                    priority: r,
                                    scope: o || this
                                }),
                                n[this.uid] || (n[this.uid] = {}),
                                void (n[this.uid][e] = s))
                    },
                    hasEventListener: function(e) {
                        return e ? !(!n[this.uid] || !n[this.uid][e]) : !!n[this.uid]
                    },
                    removeEventListener: function(e, i) {
                        e = e.toLowerCase();
                        var r = n[this.uid] && n[this.uid][e], o;
                        if (r) {
                            if (i) {
                                for (o = r.length - 1; o >= 0; o--)
                                    if (r[o].fn === i) {
                                        r.splice(o, 1);
                                        break
                                    }
                            } else
                                r = [];
                            r.length || (delete n[this.uid][e],
                                t.isEmptyObj(n[this.uid]) && delete n[this.uid])
                        }
                    },
                    removeAllEventListeners: function() {
                        n[this.uid] && delete n[this.uid]
                    },
                    dispatchEvent: function(i) {
                        var r, o, a, s, u = {}, c = !0, l;
                        if ("string" !== t.typeOf(i)) {
                            if (s = i,
                                "string" !== t.typeOf(s.type))
                                throw new e.EventException(e.EventException.UNSPECIFIED_EVENT_TYPE_ERR);
                            i = s.type,
                                s.total !== l && s.loaded !== l && (u.total = s.total,
                                u.loaded = s.loaded),
                                u.async = s.async || !1
                        }
                        if (-1 !== i.indexOf("::") ? !function(e) {
                            r = e[0],
                                i = e[1]
                        }(i.split("::")) : r = this.uid,
                            i = i.toLowerCase(),
                            o = n[r] && n[r][i]) {
                            o.sort(function(e, t) {
                                return t.priority - e.priority
                            }),
                                a = [].slice.call(arguments),
                                a.shift(),
                                u.type = i,
                                a.unshift(u);
                            var d = [];
                            t.each(o, function(e) {
                                a[0].target = e.scope,
                                    d.push(u.async ? function(t) {
                                            setTimeout(function() {
                                                t(e.fn.apply(e.scope, a) === !1)
                                            }, 1)
                                        }
                                            : function(t) {
                                            t(e.fn.apply(e.scope, a) === !1)
                                        }
                                    )
                            }),
                                d.length && t.inSeries(d, function(e) {
                                c = !e
                            })
                        }
                        return c
                    },
                    bind: function() {
                        this.addEventListener.apply(this, arguments)
                    },
                    unbind: function() {
                        this.removeEventListener.apply(this, arguments)
                    },
                    unbindAll: function() {
                        this.removeAllEventListeners.apply(this, arguments)
                    },
                    trigger: function() {
                        return this.dispatchEvent.apply(this, arguments)
                    },
                    convertEventPropsToHandlers: function(e) {
                        var n;
                        "array" !== t.typeOf(e) && (e = [e]);
                        for (var i = 0; i < e.length; i++)
                            n = "on" + e[i],
                                    "function" === t.typeOf(this[n]) ? this.addEventListener(e[i], this[n]) : "undefined" === t.typeOf(this[n]) && (this[n] = null)
                    }
                })
            }
            return n.instance = new n,
                n
        }),
        i(m, [], function() {
            var e = function(e) {
                    return unescape(encodeURIComponent(e))
                }
                , t = function(e) {
                    return decodeURIComponent(escape(e))
                }
                , n = function(e, n) {
                    if ("function" == typeof window.atob)
                        return n ? t(window.atob(e)) : window.atob(e);
                    var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", r, o, a, s, u, c, l, d, f = 0, h = 0, p = "", m = [];
                    if (!e)
                        return e;
                    e += "";
                    do
                        s = i.indexOf(e.charAt(f++)),
                            u = i.indexOf(e.charAt(f++)),
                            c = i.indexOf(e.charAt(f++)),
                            l = i.indexOf(e.charAt(f++)),
                            d = s << 18 | u << 12 | c << 6 | l,
                            r = d >> 16 & 255,
                            o = d >> 8 & 255,
                            a = 255 & d,
                            m[h++] = 64 == c ? String.fromCharCode(r) : 64 == l ? String.fromCharCode(r, o) : String.fromCharCode(r, o, a);
                    while (f < e.length);return p = m.join(""),
                        n ? t(p) : p
                }
                , i = function(t, n) {
                    if (n && e(t),
                        "function" == typeof window.btoa)
                        return window.btoa(t);
                    var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", r, o, a, s, u, c, l, d, f = 0, h = 0, p = "", m = [];
                    if (!t)
                        return t;
                    do
                        r = t.charCodeAt(f++),
                            o = t.charCodeAt(f++),
                            a = t.charCodeAt(f++),
                            d = r << 16 | o << 8 | a,
                            s = d >> 18 & 63,
                            u = d >> 12 & 63,
                            c = d >> 6 & 63,
                            l = 63 & d,
                            m[h++] = i.charAt(s) + i.charAt(u) + i.charAt(c) + i.charAt(l);
                    while (f < t.length);p = m.join("");
                    var g = t.length % 3;
                    return (g ? p.slice(0, g - 3) : p) + "===".slice(g || 3)
                };
            return {
                utf8_encode: e,
                utf8_decode: t,
                atob: n,
                btoa: i
            }
        }),
        i(g, [u, f, p], function(e, t, n) {
            function i(n, r, a, s, u) {
                var c = this, l, d = e.guid(r + "_"), f = u || "browser";
                n = n || {},
                    o[d] = this,
                    a = e.extend({
                        access_binary: !1,
                        access_image_binary: !1,
                        display_media: !1,
                        do_cors: !1,
                        drag_and_drop: !1,
                        filter_by_extension: !0,
                        resize_image: !1,
                        report_upload_progress: !1,
                        return_response_headers: !1,
                        return_response_type: !1,
                        return_status_code: !0,
                        send_custom_headers: !1,
                        select_file: !1,
                        select_folder: !1,
                        select_multiple: !0,
                        send_binary_string: !1,
                        send_browser_cookies: !0,
                        send_multipart: !0,
                        slice_blob: !1,
                        stream_upload: !1,
                        summon_file_dialog: !1,
                        upload_filesize: !0,
                        use_http_method: !0
                    }, a),
                    n.preferred_caps && (f = i.getMode(s, n.preferred_caps, f)),
                    l = function() {
                        var t = {};
                        return {
                            exec: function(e, n, i, r) {
                                return l[n] && (t[e] || (t[e] = {
                                    context: this,
                                    instance: new l[n]
                                }),
                                    t[e].instance[i]) ? t[e].instance[i].apply(this, r) : void 0
                            },
                            removeInstance: function(e) {
                                delete t[e]
                            },
                            removeAllInstances: function() {
                                var n = this;
                                e.each(t, function(t, i) {
                                    "function" === e.typeOf(t.instance.destroy) && t.instance.destroy.call(t.context),
                                        n.removeInstance(i)
                                })
                            }
                        }
                    }(),
                    e.extend(this, {
                        initialized: !1,
                        uid: d,
                        type: r,
                        mode: i.getMode(s, n.required_caps, f),
                        shimid: d + "_container",
                        clients: 0,
                        options: n,
                        can: function(t, n) {
                            var r = arguments[2] || a;
                            if ("string" === e.typeOf(t) && "undefined" === e.typeOf(n) && (t = i.parseCaps(t)),
                                "object" === e.typeOf(t)) {
                                for (var o in t)
                                    if (!this.can(o, t[o], r))
                                        return !1;
                                return !0
                            }
                            return "function" === e.typeOf(r[t]) ? r[t].call(this, n) : n === r[t]
                        },
                        getShimContainer: function() {
                            var n, i = t.get(this.shimid);
                            return i || (n = this.options.container ? t.get(this.options.container) : document.body,
                                i = document.createElement("div"),
                                i.id = this.shimid,
                                i.className = "moxie-shim moxie-shim-" + this.type,
                                e.extend(i.style, {
                                    position: "absolute",
                                    top: "0px",
                                    left: "0px",
                                    width: "1px",
                                    height: "1px",
                                    overflow: "hidden"
                                }),
                                n.appendChild(i),
                                n = null),
                                i
                        },
                        getShim: function() {
                            return l
                        },
                        shimExec: function(e, t) {
                            var n = [].slice.call(arguments, 2);
                            return c.getShim().exec.call(this, this.uid, e, t, n)
                        },
                        exec: function(e, t) {
                            var n = [].slice.call(arguments, 2);
                            return c[e] && c[e][t] ? c[e][t].apply(this, n) : c.shimExec.apply(this, arguments)
                        },
                        destroy: function() {
                            if (c) {
                                var e = t.get(this.shimid);
                                e && e.parentNode.removeChild(e),
                                    l && l.removeAllInstances(),
                                    this.unbindAll(),
                                    delete o[this.uid],
                                    this.uid = null,
                                    d = c = l = e = null
                            }
                        }
                    }),
                    this.mode && n.required_caps && !this.can(n.required_caps) && (this.mode = !1)
            }
            var r = {}
                , o = {};
            return i.order = "html5,flash,silverlight,html4",
                i.getRuntime = function(e) {
                    return o[e] ? o[e] : !1
                }
                ,
                i.addConstructor = function(e, t) {
                    t.prototype = n.instance,
                        r[e] = t
                }
                ,
                i.getConstructor = function(e) {
                    return r[e] || null
                }
                ,
                i.getInfo = function(e) {
                    var t = i.getRuntime(e);
                    return t ? {
                        uid: t.uid,
                        type: t.type,
                        mode: t.mode,
                        can: function() {
                            return t.can.apply(t, arguments)
                        }
                    } : null
                }
                ,
                i.parseCaps = function(t) {
                    var n = {};
                    return "string" !== e.typeOf(t) ? t || {} : (e.each(t.split(","), function(e) {
                        n[e] = !0
                    }),
                        n)
                }
                ,
                i.can = function(e, t) {
                    var n, r = i.getConstructor(e), o;
                    return r ? (n = new r({
                        required_caps: t
                    }),
                        o = n.mode,
                        n.destroy(),
                        !!o) : !1
                }
                ,
                i.thatCan = function(e, t) {
                    var n = (t || i.order).split(/\s*,\s*/);
                    for (var r in n)
                        if (i.can(n[r], e))
                            return n[r];
                    return null
                }
                ,
                i.getMode = function(t, n, i) {
                    var r = null;
                    if ("undefined" === e.typeOf(i) && (i = "browser"),
                        n && !e.isEmptyObj(t)) {
                        if (e.each(n, function(n, i) {
                            if (t.hasOwnProperty(i)) {
                                var o = t[i](n);
                                if ("string" == typeof o && (o = [o]),
                                    r) {
                                    if (!(r = e.arrayIntersect(r, o)))
                                        return r = !1
                                } else
                                    r = o
                            }
                        }),
                            r)
                            return -1 !== e.inArray(i, r) ? i : r[0];
                        if (r === !1)
                            return !1
                    }
                    return i
                }
                ,
                i.capTrue = function() {
                    return !0
                }
                ,
                i.capFalse = function() {
                    return !1
                }
                ,
                i.capTest = function(e) {
                    return function() {
                        return !!e
                    }
                }
                ,
                i
        }),
        i(v, [h, u, g], function(e, t, n) {
            return function i() {
                var i;
                t.extend(this, {
                    connectRuntime: function(r) {
                        function o(t) {
                            var s, u;
                            return t.length ? (s = t.shift(),
                                (u = n.getConstructor(s)) ? (i = new u(r),
                                    i.bind("Init", function() {
                                        i.initialized = !0,
                                            setTimeout(function() {
                                                i.clients++,
                                                    a.trigger("RuntimeInit", i)
                                            }, 1)
                                    }),
                                    i.bind("Error", function() {
                                        i.destroy(),
                                            o(t)
                                    }),
                                    i.mode ? void i.init() : void i.trigger("Error")) : void o(t)) : (a.trigger("RuntimeError", new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)),
                                void (i = null))
                        }
                        var a = this, s;
                        if ("string" === t.typeOf(r) ? s = r : "string" === t.typeOf(r.ruid) && (s = r.ruid),
                            s) {
                            if (i = n.getRuntime(s))
                                return i.clients++,
                                    i;
                            throw new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)
                        }
                        o((r.runtime_order || n.order).split(/\s*,\s*/))
                    },
                    getRuntime: function() {
                        return i && i.uid ? i : (i = null,
                            null)
                    },
                    disconnectRuntime: function() {
                        i && --i.clients <= 0 && (i.destroy(),
                            i = null)
                    }
                })
            }
        }),
        i(y, [u, m, v], function(e, t, n) {
            function i(o, a) {
                function s(t, n, o) {
                    var a, s = r[this.uid];
                    return "string" === e.typeOf(s) && s.length ? (a = new i(null,{
                        type: o,
                        size: n - t
                    }),
                        a.detach(s.substr(t, a.size)),
                        a) : null
                }
                n.call(this),
                    o && this.connectRuntime(o),
                    a ? "string" === e.typeOf(a) && (a = {
                        data: a
                    }) : a = {},
                    e.extend(this, {
                        uid: a.uid || e.guid("uid_"),
                        ruid: o,
                        size: a.size || 0,
                        type: a.type || "",
                        slice: function(e, t, n) {
                            return this.isDetached() ? s.apply(this, arguments) : this.getRuntime().exec.call(this, "Blob", "slice", this.getSource(), e, t, n)
                        },
                        getSource: function() {
                            return r[this.uid] ? r[this.uid] : null
                        },
                        detach: function(e) {
                            this.ruid && (this.getRuntime().exec.call(this, "Blob", "destroy"),
                                this.disconnectRuntime(),
                                this.ruid = null),
                                e = e || "";
                            var n = e.match(/^data:([^;]*);base64,/);
                            n && (this.type = n[1],
                                e = t.atob(e.substring(e.indexOf("base64,") + 7))),
                                this.size = e.length,
                                r[this.uid] = e
                        },
                        isDetached: function() {
                            return !this.ruid && "string" === e.typeOf(r[this.uid])
                        },
                        destroy: function() {
                            this.detach(),
                                delete r[this.uid]
                        }
                    }),
                    a.data ? this.detach(a.data) : r[this.uid] = a
            }
            var r = {};
            return i
        }),
        i(w, [u, l, y], function(e, t, n) {
            function i(i, r) {
                var o, a;
                if (r || (r = {}),
                    a = r.type && "" !== r.type ? r.type : t.getFileMime(r.name),
                    r.name)
                    o = r.name.replace(/\\/g, "/"),
                        o = o.substr(o.lastIndexOf("/") + 1);
                else {
                    var s = a.split("/")[0];
                    o = e.guid(("" !== s ? s : "file") + "_"),
                        t.extensions[a] && (o += "." + t.extensions[a][0])
                }
                n.apply(this, arguments),
                    e.extend(this, {
                        type: a || "",
                        name: o || e.guid("file_"),
                        lastModifiedDate: r.lastModifiedDate || (new Date).toLocaleString()
                    })
            }
            return i.prototype = n.prototype,
                i
        }),
        i(E, [u, l, f, h, p, c, w, g, v], function(e, t, n, i, r, o, a, s, u) {
            function c(r) {
                var c = this, d, f, h;
                if (-1 !== e.inArray(e.typeOf(r), ["string", "node"]) && (r = {
                    browse_button: r
                }),
                    f = n.get(r.browse_button),
                    !f)
                    throw new i.DOMException(i.DOMException.NOT_FOUND_ERR);
                h = {
                    accept: [{
                        title: o.translate("All Files"),
                        extensions: "*"
                    }],
                    name: "file",
                    multiple: !1,
                    required_caps: !1,
                    container: f.parentNode || document.body
                },
                    r = e.extend({}, h, r),
                    "string" == typeof r.required_caps && (r.required_caps = s.parseCaps(r.required_caps)),
                    "string" == typeof r.accept && (r.accept = t.mimes2extList(r.accept)),
                    d = n.get(r.container),
                    d || (d = document.body),
                    "static" === n.getStyle(d, "position") && (d.style.position = "relative"),
                    d = f = null,
                    u.call(c),
                    e.extend(c, {
                        uid: e.guid("uid_"),
                        ruid: null,
                        shimid: null,
                        files: null,
                        init: function() {
                            c.convertEventPropsToHandlers(l),
                                c.bind("RuntimeInit", function(t, i) {
                                    c.ruid = i.uid,
                                        c.shimid = i.shimid,
                                        c.bind("Ready", function() {
                                            c.trigger("Refresh")
                                        }, 999),
                                        c.bind("Change", function() {
                                            var t = i.exec.call(c, "FileInput", "getFiles");
                                            c.files = [],
                                                e.each(t, function(e) {
                                                    return 0 === e.size ? !0 : void c.files.push(new a(c.ruid,e))
                                                })
                                        }, 999),
                                        c.bind("Refresh", function() {
                                            var t, o, a, s;
                                            a = n.get(r.browse_button),
                                                s = n.get(i.shimid),
                                                a && (t = n.getPos(a, n.get(r.container)),
                                                o = n.getSize(a),
                                                s && e.extend(s.style, {
                                                top: t.y + "px",
                                                left: t.x + "px",
                                                width: o.w + "px",
                                                height: o.h + "px"
                                            })),
                                                s = a = null
                                        }),
                                        i.exec.call(c, "FileInput", "init", r)
                                }),
                                c.connectRuntime(e.extend({}, r, {
                                    required_caps: {
                                        select_file: !0
                                    }
                                }))
                        },
                        disable: function(t) {
                            var n = this.getRuntime();
                            n && n.exec.call(this, "FileInput", "disable", "undefined" === e.typeOf(t) ? !0 : t)
                        },
                        refresh: function() {
                            c.trigger("Refresh")
                        },
                        destroy: function() {
                            var t = this.getRuntime();
                            t && (t.exec.call(this, "FileInput", "destroy"),
                                this.disconnectRuntime()),
                                "array" === e.typeOf(this.files) && e.each(this.files, function(e) {
                                e.destroy()
                            }),
                                this.files = null
                        }
                    })
            }
            var l = ["ready", "change", "cancel", "mouseenter", "mouseleave", "mousedown", "mouseup"];
            return c.prototype = r.instance,
                c
        }),
        i(_, [c, f, h, u, w, v, p, l], function(e, t, n, i, r, o, a, s) {
            function u(n) {
                var a = this, u;
                "string" == typeof n && (n = {
                    drop_zone: n
                }),
                    u = {
                        accept: [{
                            title: e.translate("All Files"),
                            extensions: "*"
                        }],
                        required_caps: {
                            drag_and_drop: !0
                        }
                    },
                    n = "object" == typeof n ? i.extend({}, u, n) : u,
                    n.container = t.get(n.drop_zone) || document.body,
                    "static" === t.getStyle(n.container, "position") && (n.container.style.position = "relative"),
                    "string" == typeof n.accept && (n.accept = s.mimes2extList(n.accept)),
                    o.call(a),
                    i.extend(a, {
                        uid: i.guid("uid_"),
                        ruid: null,
                        files: null,
                        init: function() {
                            a.convertEventPropsToHandlers(c),
                                a.bind("RuntimeInit", function(e, t) {
                                    a.ruid = t.uid,
                                        a.bind("Drop", function() {
                                            var e = t.exec.call(a, "FileDrop", "getFiles");
                                            a.files = [],
                                                i.each(e, function(e) {
                                                    a.files.push(new r(a.ruid,e))
                                                })
                                        }, 999),
                                        t.exec.call(a, "FileDrop", "init", n),
                                        a.dispatchEvent("ready")
                                }),
                                a.connectRuntime(n)
                        },
                        destroy: function() {
                            var e = this.getRuntime();
                            e && (e.exec.call(this, "FileDrop", "destroy"),
                                this.disconnectRuntime()),
                                this.files = null
                        }
                    })
            }
            var c = ["ready", "dragenter", "dragleave", "drop", "error"];
            return u.prototype = a.instance,
                u
        }),
        i(x, [u, v, p], function(e, t, n) {
            function i() {
                this.uid = e.guid("uid_"),
                    t.call(this),
                    this.destroy = function() {
                        this.disconnectRuntime(),
                            this.unbindAll()
                    }
            }
            return i.prototype = n.instance,
                i
        }),
        i(b, [u, m, h, p, y, w, x], function(e, t, n, i, r, o, a) {
            function s() {
                function i(e, i) {
                    function l(e) {
                        o.readyState = s.DONE,
                            o.error = e,
                            o.trigger("error"),
                            d()
                    }
                    function d() {
                        c.destroy(),
                            c = null,
                            o.trigger("loadend")
                    }
                    function f(t) {
                        c.bind("Error", function(e, t) {
                            l(t)
                        }),
                            c.bind("Progress", function(e) {
                                o.result = t.exec.call(c, "FileReader", "getResult"),
                                    o.trigger(e)
                            }),
                            c.bind("Load", function(e) {
                                o.readyState = s.DONE,
                                    o.result = t.exec.call(c, "FileReader", "getResult"),
                                    o.trigger(e),
                                    d()
                            }),
                            t.exec.call(c, "FileReader", "read", e, i)
                    }
                    if (c = new a,
                        this.convertEventPropsToHandlers(u),
                        this.readyState === s.LOADING)
                        return l(new n.DOMException(n.DOMException.INVALID_STATE_ERR));
                    if (this.readyState = s.LOADING,
                        this.trigger("loadstart"),
                        i instanceof r)
                        if (i.isDetached()) {
                            var h = i.getSource();
                            switch (e) {
                                case "readAsText":
                                case "readAsBinaryString":
                                    this.result = h;
                                    break;
                                case "readAsDataURL":
                                    this.result = "data:" + i.type + ";base64," + t.btoa(h)
                            }
                            this.readyState = s.DONE,
                                this.trigger("load"),
                                d()
                        } else
                            f(c.connectRuntime(i.ruid));
                    else
                        l(new n.DOMException(n.DOMException.NOT_FOUND_ERR))
                }
                var o = this, c;
                e.extend(this, {
                    uid: e.guid("uid_"),
                    readyState: s.EMPTY,
                    result: null,
                    error: null,
                    readAsBinaryString: function(e) {
                        i.call(this, "readAsBinaryString", e)
                    },
                    readAsDataURL: function(e) {
                        i.call(this, "readAsDataURL", e)
                    },
                    readAsText: function(e) {
                        i.call(this, "readAsText", e)
                    },
                    abort: function() {
                        this.result = null,
                            -1 === e.inArray(this.readyState, [s.EMPTY, s.DONE]) && (this.readyState === s.LOADING && (this.readyState = s.DONE),
                            c && c.getRuntime().exec.call(this, "FileReader", "abort"),
                            this.trigger("abort"),
                            this.trigger("loadend"))
                    },
                    destroy: function() {
                        this.abort(),
                            c && (c.getRuntime().exec.call(this, "FileReader", "destroy"),
                            c.disconnectRuntime()),
                            o = c = null
                    }
                })
            }
            var u = ["loadstart", "progress", "load", "abort", "error", "loadend"];
            return s.EMPTY = 0,
                s.LOADING = 1,
                s.DONE = 2,
                s.prototype = i.instance,
                s
        }),
        i(R, [], function() {
            var e = function(t, n) {
                    for (var i = ["source", "scheme", "authority", "userInfo", "user", "pass", "host", "port", "relative", "path", "directory", "file", "query", "fragment"], r = i.length, o = {
                        http: 80,
                        https: 443
                    }, a = {}, s = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/, u = s.exec(t || ""); r--; )
                        u[r] && (a[i[r]] = u[r]);
                    if (!a.scheme) {
                        n && "string" != typeof n || (n = e(n || document.location.href)),
                            a.scheme = n.scheme,
                            a.host = n.host,
                            a.port = n.port;
                        var c = "";
                        /^[^\/]/.test(a.path) && (c = n.path,
                            /(\/|\/[^\.]+)$/.test(c) ? c += "/" : c = c.replace(/\/[^\/]+$/, "/")),
                            a.path = c + (a.path || "")
                    }
                    return a.port || (a.port = o[a.scheme] || 80),
                        a.port = parseInt(a.port, 10),
                        a.path || (a.path = "/"),
                        delete a.source,
                        a
                }
                , t = function(t) {
                    var n = {
                            http: 80,
                            https: 443
                        }
                        , i = e(t);
                    return i.scheme + "://" + i.host + (i.port !== n[i.scheme] ? ":" + i.port : "") + i.path + (i.query ? i.query : "")
                }
                , n = function(t) {
                    function n(e) {
                        return [e.scheme, e.host, e.port].join("/")
                    }
                    return "string" == typeof t && (t = e(t)),
                        n(e()) === n(t)
                };
            return {
                parseUrl: e,
                resolveUrl: t,
                hasSameOrigin: n
            }
        }),
        i(T, [u, v, m], function(e, t, n) {
            return function() {
                function i(e, t) {
                    if (!t.isDetached()) {
                        var i = this.connectRuntime(t.ruid).exec.call(this, "FileReaderSync", "read", e, t);
                        return this.disconnectRuntime(),
                            i
                    }
                    var r = t.getSource();
                    switch (e) {
                        case "readAsBinaryString":
                            return r;
                        case "readAsDataURL":
                            return "data:" + t.type + ";base64," + n.btoa(r);
                        case "readAsText":
                            for (var o = "", a = 0, s = r.length; s > a; a++)
                                o += String.fromCharCode(r[a]);
                            return o
                    }
                }
                t.call(this),
                    e.extend(this, {
                        uid: e.guid("uid_"),
                        readAsBinaryString: function(e) {
                            return i.call(this, "readAsBinaryString", e)
                        },
                        readAsDataURL: function(e) {
                            return i.call(this, "readAsDataURL", e)
                        },
                        readAsText: function(e) {
                            return i.call(this, "readAsText", e)
                        }
                    })
            }
        }),
        i(A, [h, u, y], function(e, t, n) {
            function i() {
                var e, i = [];
                t.extend(this, {
                    append: function(r, o) {
                        var a = this
                            , s = t.typeOf(o);
                        o instanceof n ? e = {
                            name: r,
                            value: o
                        } : "array" === s ? (r += "[]",
                            t.each(o, function(e) {
                                a.append(r, e)
                            })) : "object" === s ? t.each(o, function(e, t) {
                            a.append(r + "[" + t + "]", e)
                        }) : "null" === s || "undefined" === s || "number" === s && isNaN(o) ? a.append(r, "false") : i.push({
                            name: r,
                            value: o.toString()
                        })
                    },
                    hasBlob: function() {
                        return !!this.getBlob()
                    },
                    getBlob: function() {
                        return e && e.value || null
                    },
                    getBlobName: function() {
                        return e && e.name || null
                    },
                    each: function(n) {
                        t.each(i, function(e) {
                            n(e.value, e.name)
                        }),
                            e && n(e.value, e.name)
                    },
                    destroy: function() {
                        e = null,
                            i = []
                    }
                })
            }
            return i
        }),
        i(S, [u, h, p, m, R, g, x, y, T, A, d, l], function(e, t, n, i, r, o, a, s, u, c, l, d) {
            function f() {
                this.uid = e.guid("uid_")
            }
            function h() {
                function n(e, t) {
                    return y.hasOwnProperty(e) ? 1 === arguments.length ? l.can("define_property") ? y[e] : v[e] : void (l.can("define_property") ? y[e] = t : v[e] = t) : void 0
                }
                function u(t) {
                    function i() {
                        k && (k.destroy(),
                            k = null),
                            s.dispatchEvent("loadend"),
                            s = null
                    }
                    function r(r) {
                        k.bind("LoadStart", function(e) {
                            n("readyState", h.LOADING),
                                s.dispatchEvent("readystatechange"),
                                s.dispatchEvent(e),
                                I && s.upload.dispatchEvent(e)
                        }),
                            k.bind("Progress", function(e) {
                                n("readyState") !== h.LOADING && (n("readyState", h.LOADING),
                                    s.dispatchEvent("readystatechange")),
                                    s.dispatchEvent(e)
                            }),
                            k.bind("UploadProgress", function(e) {
                                I && s.upload.dispatchEvent({
                                    type: "progress",
                                    lengthComputable: !1,
                                    total: e.total,
                                    loaded: e.loaded
                                })
                            }),
                            k.bind("Load", function(t) {
                                n("readyState", h.DONE),
                                    n("status", Number(r.exec.call(k, "XMLHttpRequest", "getStatus") || 0)),
                                    n("statusText", p[n("status")] || ""),
                                    n("response", r.exec.call(k, "XMLHttpRequest", "getResponse", n("responseType"))),
                                    ~e.inArray(n("responseType"), ["text", ""]) ? n("responseText", n("response")) : "document" === n("responseType") && n("responseXML", n("response")),
                                    U = r.exec.call(k, "XMLHttpRequest", "getAllResponseHeaders"),
                                    s.dispatchEvent("readystatechange"),
                                        n("status") > 0 ? (I && s.upload.dispatchEvent(t),
                                    s.dispatchEvent(t)) : (N = !0,
                                    s.dispatchEvent("error")),
                                    i()
                            }),
                            k.bind("Abort", function(e) {
                                s.dispatchEvent(e),
                                    i()
                            }),
                            k.bind("Error", function(e) {
                                N = !0,
                                    n("readyState", h.DONE),
                                    s.dispatchEvent("readystatechange"),
                                    D = !0,
                                    s.dispatchEvent(e),
                                    i()
                            }),
                            r.exec.call(k, "XMLHttpRequest", "send", {
                                url: E,
                                method: _,
                                async: w,
                                user: b,
                                password: R,
                                headers: x,
                                mimeType: A,
                                encoding: T,
                                responseType: s.responseType,
                                withCredentials: s.withCredentials,
                                options: P
                            }, t)
                    }
                    var s = this;
                    M = (new Date).getTime(),
                        k = new a,
                        "string" == typeof P.required_caps && (P.required_caps = o.parseCaps(P.required_caps)),
                        P.required_caps = e.extend({}, P.required_caps, {
                            return_response_type: s.responseType
                        }),
                        t instanceof c && (P.required_caps.send_multipart = !0),
                        L || (P.required_caps.do_cors = !0),
                        P.ruid ? r(k.connectRuntime(P)) : (k.bind("RuntimeInit", function(e, t) {
                            r(t)
                        }),
                            k.bind("RuntimeError", function(e, t) {
                                s.dispatchEvent("RuntimeError", t)
                            }),
                            k.connectRuntime(P))
                }
                function g() {
                    n("responseText", ""),
                        n("responseXML", null),
                        n("response", null),
                        n("status", 0),
                        n("statusText", ""),
                        M = C = null
                }
                var v = this, y = {
                    timeout: 0,
                    readyState: h.UNSENT,
                    withCredentials: !1,
                    status: 0,
                    statusText: "",
                    responseType: "",
                    responseXML: null,
                    responseText: null,
                    response: null
                }, w = !0, E, _, x = {}, b, R, T = null, A = null, S = !1, O = !1, I = !1, D = !1, N = !1, L = !1, M, C, F = null, H = null, P = {}, k, U = "", B;
                e.extend(this, y, {
                    uid: e.guid("uid_"),
                    upload: new f,
                    open: function(o, a, s, u, c) {
                        var l;
                        if (!o || !a)
                            throw new t.DOMException(t.DOMException.SYNTAX_ERR);
                        if (/[\u0100-\uffff]/.test(o) || i.utf8_encode(o) !== o)
                            throw new t.DOMException(t.DOMException.SYNTAX_ERR);
                        if (~e.inArray(o.toUpperCase(), ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT", "TRACE", "TRACK"]) && (_ = o.toUpperCase()),
                            ~e.inArray(_, ["CONNECT", "TRACE", "TRACK"]))
                            throw new t.DOMException(t.DOMException.SECURITY_ERR);
                        if (a = i.utf8_encode(a),
                            l = r.parseUrl(a),
                            L = r.hasSameOrigin(l),
                            E = r.resolveUrl(a),
                            (u || c) && !L)
                            throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);
                        if (b = u || l.user,
                            R = c || l.pass,
                            w = s || !0,
                            w === !1 && (n("timeout") || n("withCredentials") || "" !== n("responseType")))
                            throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);
                        S = !w,
                            O = !1,
                            x = {},
                            g.call(this),
                            n("readyState", h.OPENED),
                            this.convertEventPropsToHandlers(["readystatechange"]),
                            this.dispatchEvent("readystatechange")
                    },
                    setRequestHeader: function(r, o) {
                        var a = ["accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "content-transfer-encoding", "date", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "user-agent", "via"];
                        if (n("readyState") !== h.OPENED || O)
                            throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
                        if (/[\u0100-\uffff]/.test(r) || i.utf8_encode(r) !== r)
                            throw new t.DOMException(t.DOMException.SYNTAX_ERR);
                        return r = e.trim(r).toLowerCase(),
                                ~e.inArray(r, a) || /^(proxy\-|sec\-)/.test(r) ? !1 : (x[r] ? x[r] += ", " + o : x[r] = o,
                            !0)
                    },
                    getAllResponseHeaders: function() {
                        return U || ""
                    },
                    getResponseHeader: function(t) {
                        return t = t.toLowerCase(),
                                N || ~e.inArray(t, ["set-cookie", "set-cookie2"]) ? null : U && "" !== U && (B || (B = {},
                            e.each(U.split(/\r\n/), function(t) {
                                var n = t.split(/:\s+/);
                                2 === n.length && (n[0] = e.trim(n[0]),
                                    B[n[0].toLowerCase()] = {
                                        header: n[0],
                                        value: e.trim(n[1])
                                    })
                            })),
                            B.hasOwnProperty(t)) ? B[t].header + ": " + B[t].value : null
                    },
                    overrideMimeType: function(i) {
                        var r, o;
                        if (~e.inArray(n("readyState"), [h.LOADING, h.DONE]))
                            throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
                        if (i = e.trim(i.toLowerCase()),
                            /;/.test(i) && (r = i.match(/^([^;]+)(?:;\scharset\=)?(.*)$/)) && (i = r[1],
                            r[2] && (o = r[2])),
                            !d.mimes[i])
                            throw new t.DOMException(t.DOMException.SYNTAX_ERR);
                        F = i,
                            H = o
                    },
                    send: function(n, r) {
                        if (P = "string" === e.typeOf(r) ? {
                            ruid: r
                        } : r ? r : {},
                            this.convertEventPropsToHandlers(m),
                            this.upload.convertEventPropsToHandlers(m),
                            this.readyState !== h.OPENED || O)
                            throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
                        if (n instanceof s)
                            P.ruid = n.ruid,
                                A = n.type || "application/octet-stream";
                        else if (n instanceof c) {
                            if (n.hasBlob()) {
                                var o = n.getBlob();
                                P.ruid = o.ruid,
                                    A = o.type || "application/octet-stream"
                            }
                        } else
                            "string" == typeof n && (T = "UTF-8",
                                A = "text/plain;charset=UTF-8",
                                n = i.utf8_encode(n));
                        this.withCredentials || (this.withCredentials = P.required_caps && P.required_caps.send_browser_cookies && !L),
                            I = !S && this.upload.hasEventListener(),
                            N = !1,
                            D = !n,
                            S || (O = !0),
                            u.call(this, n)
                    },
                    abort: function() {
                        if (N = !0,
                            S = !1,
                            ~e.inArray(n("readyState"), [h.UNSENT, h.OPENED, h.DONE]))
                            n("readyState", h.UNSENT);
                        else {
                            if (n("readyState", h.DONE),
                                O = !1,
                                !k)
                                throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);
                            k.getRuntime().exec.call(k, "XMLHttpRequest", "abort", D),
                                D = !0
                        }
                    },
                    destroy: function() {
                        k && ("function" === e.typeOf(k.destroy) && k.destroy(),
                            k = null),
                            this.unbindAll(),
                            this.upload && (this.upload.unbindAll(),
                            this.upload = null)
                    }
                })
            }
            var p = {
                100: "Continue",
                101: "Switching Protocols",
                102: "Processing",
                200: "OK",
                201: "Created",
                202: "Accepted",
                203: "Non-Authoritative Information",
                204: "No Content",
                205: "Reset Content",
                206: "Partial Content",
                207: "Multi-Status",
                226: "IM Used",
                300: "Multiple Choices",
                301: "Moved Permanently",
                302: "Found",
                303: "See Other",
                304: "Not Modified",
                305: "Use Proxy",
                306: "Reserved",
                307: "Temporary Redirect",
                400: "Bad Request",
                401: "Unauthorized",
                402: "Payment Required",
                403: "Forbidden",
                404: "Not Found",
                405: "Method Not Allowed",
                406: "Not Acceptable",
                407: "Proxy Authentication Required",
                408: "Request Timeout",
                409: "Conflict",
                410: "Gone",
                411: "Length Required",
                412: "Precondition Failed",
                413: "Request Entity Too Large",
                414: "Request-URI Too Long",
                415: "Unsupported Media Type",
                416: "Requested Range Not Satisfiable",
                417: "Expectation Failed",
                422: "Unprocessable Entity",
                423: "Locked",
                424: "Failed Dependency",
                426: "Upgrade Required",
                500: "Internal Server Error",
                501: "Not Implemented",
                502: "Bad Gateway",
                503: "Service Unavailable",
                504: "Gateway Timeout",
                505: "HTTP Version Not Supported",
                506: "Variant Also Negotiates",
                507: "Insufficient Storage",
                510: "Not Extended"
            };
            f.prototype = n.instance;
            var m = ["loadstart", "progress", "abort", "error", "load", "timeout", "loadend"]
                , g = 1
                , v = 2;
            return h.UNSENT = 0,
                h.OPENED = 1,
                h.HEADERS_RECEIVED = 2,
                h.LOADING = 3,
                h.DONE = 4,
                h.prototype = n.instance,
                h
        }),
        i(O, [u, m, v, p], function(e, t, n, i) {
            function r() {
                function i() {
                    l = d = 0,
                        c = this.result = null
                }
                function o(t, n) {
                    var i = this;
                    u = n,
                        i.bind("TransportingProgress", function(t) {
                            d = t.loaded,
                                l > d && -1 === e.inArray(i.state, [r.IDLE, r.DONE]) && a.call(i)
                        }, 999),
                        i.bind("TransportingComplete", function() {
                            d = l,
                                i.state = r.DONE,
                                c = null,
                                i.result = u.exec.call(i, "Transporter", "getAsBlob", t || "")
                        }, 999),
                        i.state = r.BUSY,
                        i.trigger("TransportingStarted"),
                        a.call(i)
                }
                function a() {
                    var e = this, n, i = l - d;
                    f > i && (f = i),
                        n = t.btoa(c.substr(d, f)),
                        u.exec.call(e, "Transporter", "receive", n, l)
                }
                var s, u, c, l, d, f;
                n.call(this),
                    e.extend(this, {
                        uid: e.guid("uid_"),
                        state: r.IDLE,
                        result: null,
                        transport: function(t, n, r) {
                            var a = this;
                            if (r = e.extend({
                                chunk_size: 204798
                            }, r),
                                (s = r.chunk_size % 3) && (r.chunk_size += 3 - s),
                                f = r.chunk_size,
                                i.call(this),
                                c = t,
                                l = t.length,
                                "string" === e.typeOf(r) || r.ruid)
                                o.call(a, n, this.connectRuntime(r));
                            else {
                                var u = function(e, t) {
                                    a.unbind("RuntimeInit", u),
                                        o.call(a, n, t)
                                };
                                this.bind("RuntimeInit", u),
                                    this.connectRuntime(r)
                            }
                        },
                        abort: function() {
                            var e = this;
                            e.state = r.IDLE,
                                u && (u.exec.call(e, "Transporter", "clear"),
                                e.trigger("TransportingAborted")),
                                i.call(e)
                        },
                        destroy: function() {
                            this.unbindAll(),
                                u = null,
                                this.disconnectRuntime(),
                                i.call(this)
                        }
                    })
            }
            return r.IDLE = 0,
                r.BUSY = 1,
                r.DONE = 2,
                r.prototype = i.instance,
                r
        }),
        i(I, [u, f, h, T, S, g, v, O, d, p, y, w, m], function(e, t, n, i, r, o, a, s, u, c, l, d, f) {
            function h() {
                function i(e) {
                    e || (e = this.getRuntime().exec.call(this, "Image", "getInfo")),
                        this.size = e.size,
                        this.width = e.width,
                        this.height = e.height,
                        this.type = e.type,
                        this.meta = e.meta,
                        "" === this.name && (this.name = e.name)
                }
                function c(t) {
                    var i = e.typeOf(t);
                    try {
                        if (t instanceof h) {
                            if (!t.size)
                                throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);
                            m.apply(this, arguments)
                        } else if (t instanceof l) {
                            if (!~e.inArray(t.type, ["image/jpeg", "image/png"]))
                                throw new n.ImageError(n.ImageError.WRONG_FORMAT);
                            g.apply(this, arguments)
                        } else if (-1 !== e.inArray(i, ["blob", "file"]))
                            c.call(this, new d(null,t), arguments[1]);
                        else if ("string" === i)
                            /^data:[^;]*;base64,/.test(t) ? c.call(this, new l(null,{
                                data: t
                            }), arguments[1]) : v.apply(this, arguments);
                        else {
                            if ("node" !== i || "img" !== t.nodeName.toLowerCase())
                                throw new n.DOMException(n.DOMException.TYPE_MISMATCH_ERR);
                            c.call(this, t.src, arguments[1])
                        }
                    } catch (r) {
                        this.trigger("error", r.code)
                    }
                }
                function m(t, n) {
                    var i = this.connectRuntime(t.ruid);
                    this.ruid = i.uid,
                        i.exec.call(this, "Image", "loadFromImage", t, "undefined" === e.typeOf(n) ? !0 : n)
                }
                function g(t, n) {
                    function i(e) {
                        r.ruid = e.uid,
                            e.exec.call(r, "Image", "loadFromBlob", t)
                    }
                    var r = this;
                    r.name = t.name || "",
                        t.isDetached() ? (this.bind("RuntimeInit", function(e, t) {
                            i(t)
                        }),
                            n && "string" == typeof n.required_caps && (n.required_caps = o.parseCaps(n.required_caps)),
                            this.connectRuntime(e.extend({
                                required_caps: {
                                    access_image_binary: !0,
                                    resize_image: !0
                                }
                            }, n))) : i(this.connectRuntime(t.ruid))
                }
                function v(e, t) {
                    var n = this, i;
                    i = new r,
                        i.open("get", e),
                        i.responseType = "blob",
                        i.onprogress = function(e) {
                            n.trigger(e)
                        }
                        ,
                        i.onload = function() {
                            g.call(n, i.response, !0)
                        }
                        ,
                        i.onerror = function(e) {
                            n.trigger(e)
                        }
                        ,
                        i.onloadend = function() {
                            i.destroy()
                        }
                        ,
                        i.bind("RuntimeError", function(e, t) {
                            n.trigger("RuntimeError", t)
                        }),
                        i.send(null, t)
                }
                a.call(this),
                    e.extend(this, {
                        uid: e.guid("uid_"),
                        ruid: null,
                        name: "",
                        size: 0,
                        width: 0,
                        height: 0,
                        type: "",
                        meta: {},
                        clone: function() {
                            this.load.apply(this, arguments)
                        },
                        load: function() {
                            this.bind("Load Resize", function() {
                                i.call(this)
                            }, 999),
                                this.convertEventPropsToHandlers(p),
                                c.apply(this, arguments)
                        },
                        downsize: function(t) {
                            var i = {
                                width: this.width,
                                height: this.height,
                                crop: !1,
                                preserveHeaders: !0
                            };
                            t = "object" == typeof t ? e.extend(i, t) : e.extend(i, {
                                width: arguments[0],
                                height: arguments[1],
                                crop: arguments[2],
                                preserveHeaders: arguments[3]
                            });
                            try {
                                if (!this.size)
                                    throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);
                                if (this.width > h.MAX_RESIZE_WIDTH || this.height > h.MAX_RESIZE_HEIGHT)
                                    throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);
                                this.getRuntime().exec.call(this, "Image", "downsize", t.width, t.height, t.crop, t.preserveHeaders)
                            } catch (r) {
                                this.trigger("error", r.code)
                            }
                        },
                        crop: function(e, t, n) {
                            this.downsize(e, t, !0, n)
                        },
                        getAsCanvas: function() {
                            if (!u.can("create_canvas"))
                                throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);
                            var e = this.connectRuntime(this.ruid);
                            return e.exec.call(this, "Image", "getAsCanvas")
                        },
                        getAsBlob: function(e, t) {
                            if (!this.size)
                                throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);
                            return e || (e = "image/jpeg"),
                                "image/jpeg" !== e || t || (t = 90),
                                this.getRuntime().exec.call(this, "Image", "getAsBlob", e, t)
                        },
                        getAsDataURL: function(e, t) {
                            if (!this.size)
                                throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);
                            return this.getRuntime().exec.call(this, "Image", "getAsDataURL", e, t)
                        },
                        getAsBinaryString: function(e, t) {
                            var n = this.getAsDataURL(e, t);
                            return f.atob(n.substring(n.indexOf("base64,") + 7))
                        },
                        embed: function(i) {
                            function r() {
                                if (u.can("create_canvas")) {
                                    var t = a.getAsCanvas();
                                    if (t)
                                        return i.appendChild(t),
                                            t = null,
                                            a.destroy(),
                                            void o.trigger("embedded")
                                }
                                var r = a.getAsDataURL(c, l);
                                if (!r)
                                    throw new n.ImageError(n.ImageError.WRONG_FORMAT);
                                if (u.can("use_data_uri_of", r.length))
                                    i.innerHTML = '<img src="' + r + '" width="' + a.width + '" height="' + a.height + '" />',
                                        a.destroy(),
                                        o.trigger("embedded");
                                else {
                                    var d = new s;
                                    d.bind("TransportingComplete", function() {
                                        v = o.connectRuntime(this.result.ruid),
                                            o.bind("Embedded", function() {
                                                e.extend(v.getShimContainer().style, {
                                                    top: "0px",
                                                    left: "0px",
                                                    width: a.width + "px",
                                                    height: a.height + "px"
                                                }),
                                                    v = null
                                            }, 999),
                                            v.exec.call(o, "ImageView", "display", this.result.uid, m, g),
                                            a.destroy()
                                    }),
                                        d.transport(f.atob(r.substring(r.indexOf("base64,") + 7)), c, e.extend({}, p, {
                                            required_caps: {
                                                display_media: !0
                                            },
                                            runtime_order: "flash,silverlight",
                                            container: i
                                        }))
                                }
                            }
                            var o = this, a, c, l, d, p = arguments[1] || {}, m = this.width, g = this.height, v;
                            try {
                                if (!(i = t.get(i)))
                                    throw new n.DOMException(n.DOMException.INVALID_NODE_TYPE_ERR);
                                if (!this.size)
                                    throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);
                                if (this.width > h.MAX_RESIZE_WIDTH || this.height > h.MAX_RESIZE_HEIGHT)
                                    throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);
                                if (c = p.type || this.type || "image/jpeg",
                                    l = p.quality || 90,
                                    d = "undefined" !== e.typeOf(p.crop) ? p.crop : !1,
                                    p.width)
                                    m = p.width,
                                        g = p.height || m;
                                else {
                                    var y = t.getSize(i);
                                    y.w && y.h && (m = y.w,
                                        g = y.h)
                                }
                                return a = new h,
                                    a.bind("Resize", function() {
                                        r.call(o)
                                    }),
                                    a.bind("Load", function() {
                                        a.downsize(m, g, d, !1)
                                    }),
                                    a.clone(this, !1),
                                    a
                            } catch (w) {
                                this.trigger("error", w.code)
                            }
                        },
                        destroy: function() {
                            this.ruid && (this.getRuntime().exec.call(this, "Image", "destroy"),
                                this.disconnectRuntime()),
                                this.unbindAll()
                        }
                    })
            }
            var p = ["progress", "load", "error", "resize", "embedded"];
            return h.MAX_RESIZE_WIDTH = 6500,
                h.MAX_RESIZE_HEIGHT = 6500,
                h.prototype = c.instance,
                h
        }),
        i(D, [u, h, g, d], function(e, t, n, i) {
            function r(t) {
                var r = this
                    , s = n.capTest
                    , u = n.capTrue
                    , c = e.extend({
                        access_binary: s(window.FileReader || window.File && window.File.getAsDataURL),
                        access_image_binary: function() {
                            return r.can("access_binary") && !!a.Image
                        },
                        display_media: s(i.can("create_canvas") || i.can("use_data_uri_over32kb")),
                        do_cors: s(window.XMLHttpRequest && "withCredentials"in new XMLHttpRequest),
                        drag_and_drop: s(function() {
                            var e = document.createElement("div");
                            return ("draggable"in e || "ondragstart"in e && "ondrop"in e) && ("IE" !== i.browser || i.version > 9)
                        }()),
                        filter_by_extension: s(function() {
                            return "Chrome" === i.browser && i.version >= 28 || "IE" === i.browser && i.version >= 10
                        }()),
                        return_response_headers: u,
                        return_response_type: function(e) {
                            return "json" === e && window.JSON ? !0 : i.can("return_response_type", e)
                        },
                        return_status_code: u,
                        report_upload_progress: s(window.XMLHttpRequest && (new XMLHttpRequest).upload),
                        resize_image: function() {
                            return r.can("access_binary") && i.can("create_canvas")
                        },
                        select_file: function() {
                            return i.can("use_fileinput") && window.File
                        },
                        select_folder: function() {
                            return r.can("select_file") && "Chrome" === i.browser && i.version >= 21
                        },
                        select_multiple: function() {
                            return !(!r.can("select_file") || "Safari" === i.browser && "Windows" === i.os || "iOS" === i.os && i.verComp(i.osVersion, "7.0.4", "<"))
                        },
                        send_binary_string: s(window.XMLHttpRequest && ((new XMLHttpRequest).sendAsBinary || window.Uint8Array && window.ArrayBuffer)),
                        send_custom_headers: s(window.XMLHttpRequest),
                        send_multipart: function() {
                            return !!(window.XMLHttpRequest && (new XMLHttpRequest).upload && window.FormData) || r.can("send_binary_string")
                        },
                        slice_blob: s(window.File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice)),
                        stream_upload: function() {
                            return r.can("slice_blob") && r.can("send_multipart")
                        },
                        summon_file_dialog: s(function() {
                            return "Firefox" === i.browser && i.version >= 4 || "Opera" === i.browser && i.version >= 12 || "IE" === i.browser && i.version >= 10 || !!~e.inArray(i.browser, ["Chrome", "Safari"])
                        }()),
                        upload_filesize: u
                    }, arguments[2]);
                n.call(this, t, arguments[1] || o, c),
                    e.extend(this, {
                        init: function() {
                            this.trigger("Init")
                        },
                        destroy: function(e) {
                            return function() {
                                e.call(r),
                                    e = r = null
                            }
                        }(this.destroy)
                    }),
                    e.extend(this.getShim(), a)
            }
            var o = "html5"
                , a = {};
            return n.addConstructor(o, r),
                a
        }),
        i(N, [D, y], function(e, t) {
            function n() {
                function e(e, t, n) {
                    var i;
                    if (!window.File.prototype.slice)
                        return (i = window.File.prototype.webkitSlice || window.File.prototype.mozSlice) ? i.call(e, t, n) : null;
                    try {
                        return e.slice(),
                            e.slice(t, n)
                    } catch (r) {
                        return e.slice(t, n - t)
                    }
                }
                this.slice = function() {
                    return new t(this.getRuntime().uid,e.apply(this, arguments))
                }
            }
            return e.Blob = n
        }),
        i(L, [u], function(e) {
            function t() {
                this.returnValue = !1
            }
            function n() {
                this.cancelBubble = !0
            }
            var i = {}
                , r = "moxie_" + e.guid()
                , o = function(o, a, s, u) {
                    var c, l;
                    a = a.toLowerCase(),
                        o.addEventListener ? (c = s,
                            o.addEventListener(a, c, !1)) : o.attachEvent && (c = function() {
                            var e = window.event;
                            e.target || (e.target = e.srcElement),
                                e.preventDefault = t,
                                e.stopPropagation = n,
                                s(e)
                        }
                            ,
                            o.attachEvent("on" + a, c)),
                        o[r] || (o[r] = e.guid()),
                        i.hasOwnProperty(o[r]) || (i[o[r]] = {}),
                        l = i[o[r]],
                        l.hasOwnProperty(a) || (l[a] = []),
                        l[a].push({
                            func: c,
                            orig: s,
                            key: u
                        })
                }
                , a = function(t, n, o) {
                    var a, s;
                    if (n = n.toLowerCase(),
                        t[r] && i[t[r]] && i[t[r]][n]) {
                        a = i[t[r]][n];
                        for (var u = a.length - 1; u >= 0 && (a[u].orig !== o && a[u].key !== o || (t.removeEventListener ? t.removeEventListener(n, a[u].func, !1) : t.detachEvent && t.detachEvent("on" + n, a[u].func),
                            a[u].orig = null,
                            a[u].func = null,
                            a.splice(u, 1),
                            o === s)); u--)
                            ;
                        if (a.length || delete i[t[r]][n],
                            e.isEmptyObj(i[t[r]])) {
                            delete i[t[r]];
                            try {
                                delete t[r]
                            } catch (c) {
                                t[r] = s
                            }
                        }
                    }
                }
                , s = function(t, n) {
                    t && t[r] && e.each(i[t[r]], function(e, i) {
                        a(t, i, n)
                    })
                };
            return {
                addEvent: o,
                removeEvent: a,
                removeAllEvents: s
            }
        }),
        i(M, [D, u, f, L, l, d], function(e, t, n, i, r, o) {
            function a() {
                var e = [], a;
                t.extend(this, {
                    init: function(s) {
                        var u = this, c = u.getRuntime(), l, d, f, h, p, m;
                        a = s,
                            e = [],
                            f = a.accept.mimes || r.extList2mimes(a.accept, c.can("filter_by_extension")),
                            d = c.getShimContainer(),
                            d.innerHTML = '<input id="' + c.uid + '" type="file" style="font-size:999px;opacity:0;"' + (a.multiple && c.can("select_multiple") ? "multiple" : "") + (a.directory && c.can("select_folder") ? "webkitdirectory directory" : "") + (f ? ' accept="' + f.join(",") + '"' : "") + "/>",
                            l = n.get(c.uid),
                            t.extend(l.style, {
                                position: "absolute",
                                top: 0,
                                left: 0,
                                width: "100%",
                                height: "100%"
                            }),
                            h = n.get(a.browse_button),
                            c.can("summon_file_dialog") && ("static" === n.getStyle(h, "position") && (h.style.position = "relative"),
                            p = parseInt(n.getStyle(h, "z-index"), 10) || 1,
                            h.style.zIndex = p,
                            d.style.zIndex = p - 1,
                            i.addEvent(h, "click", function(e) {
                                var t = n.get(c.uid);
                                t && !t.disabled && t.click(),
                                    e.preventDefault()
                            }, u.uid)),
                            m = c.can("summon_file_dialog") ? h : d,
                            i.addEvent(m, "mouseover", function() {
                                u.trigger("mouseenter")
                            }, u.uid),
                            i.addEvent(m, "mouseout", function() {
                                u.trigger("mouseleave")
                            }, u.uid),
                            i.addEvent(m, "mousedown", function() {
                                u.trigger("mousedown")
                            }, u.uid),
                            i.addEvent(n.get(a.container), "mouseup", function() {
                                u.trigger("mouseup")
                            }, u.uid),
                            l.onchange = function g() {
                                if (e = [],
                                    a.directory ? t.each(this.files, function(t) {
                                        "." !== t.name && e.push(t)
                                    }) : e = [].slice.call(this.files),
                                    "IE" !== o.browser && "IEMobile" !== o.browser)
                                    this.value = "";
                                else {
                                    var n = this.cloneNode(!0);
                                    this.parentNode.replaceChild(n, this),
                                        n.onchange = g
                                }
                                u.trigger("change")
                            }
                            ,
                            u.trigger({
                                type: "ready",
                                async: !0
                            }),
                            d = null
                    },
                    getFiles: function() {
                        return e
                    },
                    disable: function(e) {
                        var t = this.getRuntime(), i;
                        (i = n.get(t.uid)) && (i.disabled = !!e)
                    },
                    destroy: function() {
                        var t = this.getRuntime()
                            , r = t.getShim()
                            , o = t.getShimContainer();
                        i.removeAllEvents(o, this.uid),
                            i.removeAllEvents(a && n.get(a.container), this.uid),
                            i.removeAllEvents(a && n.get(a.browse_button), this.uid),
                            o && (o.innerHTML = ""),
                            r.removeInstance(this.uid),
                            e = a = o = r = null
                    }
                })
            }
            return e.FileInput = a
        }),
        i(C, [D, u, f, L, l], function(e, t, n, i, r) {
            function o() {
                function e(e) {
                    if (!e.dataTransfer || !e.dataTransfer.types)
                        return !1;
                    var n = t.toArray(e.dataTransfer.types || []);
                    return -1 !== t.inArray("Files", n) || -1 !== t.inArray("public.file-url", n) || -1 !== t.inArray("application/x-moz-file", n)
                }
                function o(e) {
                    for (var n = [], i = 0; i < e.length; i++)
                        [].push.apply(n, e[i].extensions.split(/\s*,\s*/));
                    return -1 === t.inArray("*", n) ? n : []
                }
                function a(e) {
                    if (!f.length)
                        return !0;
                    var n = r.getFileExtension(e.name);
                    return !n || -1 !== t.inArray(n, f)
                }
                function s(e, n) {
                    var i = [];
                    t.each(e, function(e) {
                        var t = e.webkitGetAsEntry();
                        if (t)
                            if (t.isFile) {
                                var n = e.getAsFile();
                                a(n) && d.push(n)
                            } else
                                i.push(t)
                    }),
                        i.length ? u(i, n) : n()
                }
                function u(e, n) {
                    var i = [];
                    t.each(e, function(e) {
                        i.push(function(t) {
                            c(e, t)
                        })
                    }),
                        t.inSeries(i, function() {
                            n()
                        })
                }
                function c(e, t) {
                    e.isFile ? e.file(function(e) {
                        a(e) && d.push(e),
                            t()
                    }, function() {
                        t()
                    }) : e.isDirectory ? l(e, t) : t()
                }
                function l(e, t) {
                    function n(e) {
                        r.readEntries(function(t) {
                            t.length ? ([].push.apply(i, t),
                                n(e)) : e()
                        }, e)
                    }
                    var i = []
                        , r = e.createReader();
                    n(function() {
                        u(i, t)
                    })
                }
                var d = [], f = [], h;
                t.extend(this, {
                    init: function(n) {
                        var r = this, u;
                        h = n,
                            f = o(h.accept),
                            u = h.container,
                            i.addEvent(u, "dragover", function(t) {
                                e(t) && (t.preventDefault(),
                                    t.dataTransfer.dropEffect = "copy")
                            }, r.uid),
                            i.addEvent(u, "drop", function(n) {
                                e(n) && (n.preventDefault(),
                                    d = [],
                                        n.dataTransfer.items && n.dataTransfer.items[0].webkitGetAsEntry ? s(n.dataTransfer.items, function() {
                                    r.trigger("drop")
                                }) : (t.each(n.dataTransfer.files, function(e) {
                                    a(e) && d.push(e)
                                }),
                                    r.trigger("drop")))
                            }, r.uid),
                            i.addEvent(u, "dragenter", function(e) {
                                r.trigger("dragenter")
                            }, r.uid),
                            i.addEvent(u, "dragleave", function(e) {
                                r.trigger("dragleave")
                            }, r.uid)
                    },
                    getFiles: function() {
                        return d
                    },
                    destroy: function() {
                        i.removeAllEvents(h && n.get(h.container), this.uid),
                            d = f = h = null
                    }
                })
            }
            return e.FileDrop = o
        }),
        i(F, [D, m, u], function(e, t, n) {
            function i() {
                function e(e) {
                    return t.atob(e.substring(e.indexOf("base64,") + 7))
                }
                var i, r = !1;
                n.extend(this, {
                    read: function(e, t) {
                        var o = this;
                        i = new window.FileReader,
                            i.addEventListener("progress", function(e) {
                                o.trigger(e)
                            }),
                            i.addEventListener("load", function(e) {
                                o.trigger(e)
                            }),
                            i.addEventListener("error", function(e) {
                                o.trigger(e, i.error)
                            }),
                            i.addEventListener("loadend", function() {
                                i = null
                            }),
                                "function" === n.typeOf(i[e]) ? (r = !1,
                            i[e](t.getSource())) : "readAsBinaryString" === e && (r = !0,
                            i.readAsDataURL(t.getSource()))
                    },
                    getResult: function() {
                        return i && i.result ? r ? e(i.result) : i.result : null
                    },
                    abort: function() {
                        i && i.abort()
                    },
                    destroy: function() {
                        i = null
                    }
                })
            }
            return e.FileReader = i
        }),
        i(H, [D, u, l, R, w, y, A, h, d], function(e, t, n, i, r, o, a, s, u) {
            function c() {
                function e(e, t) {
                    var n = this, i, r;
                    i = t.getBlob().getSource(),
                        r = new window.FileReader,
                        r.onload = function() {
                            t.append(t.getBlobName(), new o(null,{
                                type: i.type,
                                data: r.result
                            })),
                                f.send.call(n, e, t)
                        }
                        ,
                        r.readAsBinaryString(i)
                }
                function c() {
                    return !window.XMLHttpRequest || "IE" === u.browser && u.version < 8 ? function() {
                        for (var e = ["Msxml2.XMLHTTP.6.0", "Microsoft.XMLHTTP"], t = 0; t < e.length; t++)
                            try {
                                return new ActiveXObject(e[t])
                            } catch (n) {}
                    }() : new window.XMLHttpRequest
                }
                function l(e) {
                    var t = e.responseXML
                        , n = e.responseText;
                    return "IE" === u.browser && n && t && !t.documentElement && /[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type")) && (t = new window.ActiveXObject("Microsoft.XMLDOM"),
                        t.async = !1,
                        t.validateOnParse = !1,
                        t.loadXML(n)),
                            t && ("IE" === u.browser && 0 !== t.parseError || !t.documentElement || "parsererror" === t.documentElement.tagName) ? null : t
                }
                function d(e) {
                    var t = "----moxieboundary" + (new Date).getTime()
                        , n = "--"
                        , i = "\r\n"
                        , r = ""
                        , a = this.getRuntime();
                    if (!a.can("send_binary_string"))
                        throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);
                    return h.setRequestHeader("Content-Type", "multipart/form-data;boundary=" + t),
                        e.each(function(e, a) {
                            r += e instanceof o ? n + t + i + 'Content-Disposition: form-data; name="' + a + '"; filename="' + unescape(encodeURIComponent(e.name || "blob")) + '"' + i + "Content-Type:" + (e.type || "application/octet-stream") + i + i + e.getSource() + i : n + t + i + 'Content-Disposition: form-data; name="' + a + '"' + i + i + unescape(encodeURIComponent(e)) + i
                        }),
                        r += n + t + n + i
                }
                var f = this, h, p;
                t.extend(this, {
                    send: function(n, r) {
                        var s = this
                            , l = "Mozilla" === u.browser && u.version >= 4 && u.version < 7
                            , f = "Android Browser" === u.browser
                            , m = !1;
                        if (p = n.url.replace(/^.+?\/([\w\-\.]+)$/, "$1").toLowerCase(),
                            h = c(),
                            h.open(n.method, n.url, n.async, n.user, n.password),
                            r instanceof o)
                            r.isDetached() && (m = !0),
                                r = r.getSource();
                        else if (r instanceof a) {
                            if (r.hasBlob())
                                if (r.getBlob().isDetached())
                                    r = d.call(s, r),
                                        m = !0;
                                else if ((l || f) && "blob" === t.typeOf(r.getBlob().getSource()) && window.FileReader)
                                    return void e.call(s, n, r);
                            if (r instanceof a) {
                                var g = new window.FormData;
                                r.each(function(e, t) {
                                    e instanceof o ? g.append(t, e.getSource()) : g.append(t, e)
                                }),
                                    r = g
                            }
                        }
                        h.upload ? (n.withCredentials && (h.withCredentials = !0),
                            h.addEventListener("load", function(e) {
                                s.trigger(e)
                            }),
                            h.addEventListener("error", function(e) {
                                s.trigger(e)
                            }),
                            h.addEventListener("progress", function(e) {
                                s.trigger(e)
                            }),
                            h.upload.addEventListener("progress", function(e) {
                                s.trigger({
                                    type: "UploadProgress",
                                    loaded: e.loaded,
                                    total: e.total
                                })
                            })) : h.onreadystatechange = function v() {
                            switch (h.readyState) {
                                case 1:
                                    break;
                                case 2:
                                    break;
                                case 3:
                                    var e, t;
                                    try {
                                        i.hasSameOrigin(n.url) && (e = h.getResponseHeader("Content-Length") || 0),
                                            h.responseText && (t = h.responseText.length)
                                    } catch (r) {
                                        e = t = 0
                                    }
                                    s.trigger({
                                        type: "progress",
                                        lengthComputable: !!e,
                                        total: parseInt(e, 10),
                                        loaded: t
                                    });
                                    break;
                                case 4:
                                    h.onreadystatechange = function() {}
                                        ,
                                        s.trigger(0 === h.status ? "error" : "load")
                            }
                        }
                            ,
                            t.isEmptyObj(n.headers) || t.each(n.headers, function(e, t) {
                            h.setRequestHeader(t, e)
                        }),
                            "" !== n.responseType && "responseType"in h && (h.responseType = "json" !== n.responseType || u.can("return_response_type", "json") ? n.responseType : "text"),
                            m ? h.sendAsBinary ? h.sendAsBinary(r) : !function() {
                                for (var e = new Uint8Array(r.length), t = 0; t < r.length; t++)
                                    e[t] = 255 & r.charCodeAt(t);
                                h.send(e.buffer)
                            }() : h.send(r),
                            s.trigger("loadstart")
                    },
                    getStatus: function() {
                        try {
                            if (h)
                                return h.status
                        } catch (e) {}
                        return 0
                    },
                    getResponse: function(e) {
                        var t = this.getRuntime();
                        try {
                            switch (e) {
                                case "blob":
                                    var i = new r(t.uid,h.response)
                                        , o = h.getResponseHeader("Content-Disposition");
                                    if (o) {
                                        var a = o.match(/filename=([\'\"'])([^\1]+)\1/);
                                        a && (p = a[2])
                                    }
                                    return i.name = p,
                                        i.type || (i.type = n.getFileMime(p)),
                                        i;
                                case "json":
                                    return u.can("return_response_type", "json") ? h.response : 200 === h.status && window.JSON ? JSON.parse(h.responseText) : null;
                                case "document":
                                    return l(h);
                                default:
                                    return "" !== h.responseText ? h.responseText : null
                            }
                        } catch (s) {
                            return null
                        }
                    },
                    getAllResponseHeaders: function() {
                        try {
                            return h.getAllResponseHeaders()
                        } catch (e) {}
                        return ""
                    },
                    abort: function() {
                        h && h.abort()
                    },
                    destroy: function() {
                        f = p = null
                    }
                })
            }
            return e.XMLHttpRequest = c
        }),
        i(P, [], function() {
            return function() {
                function e(e, t) {
                    var n = r ? 0 : -8 * (t - 1), i = 0, a;
                    for (a = 0; t > a; a++)
                        i |= o.charCodeAt(e + a) << Math.abs(n + 8 * a);
                    return i
                }
                function n(e, t, n) {
                    n = 3 === arguments.length ? n : o.length - t - 1,
                        o = o.substr(0, t) + e + o.substr(n + t)
                }
                function i(e, t, i) {
                    var o = "", a = r ? 0 : -8 * (i - 1), s;
                    for (s = 0; i > s; s++)
                        o += String.fromCharCode(t >> Math.abs(a + 8 * s) & 255);
                    n(o, e, i)
                }
                var r = !1, o;
                return {
                    II: function(e) {
                        return e === t ? r : void (r = e)
                    },
                    init: function(e) {
                        r = !1,
                            o = e
                    },
                    SEGMENT: function(e, t, i) {
                        switch (arguments.length) {
                            case 1:
                                return o.substr(e, o.length - e - 1);
                            case 2:
                                return o.substr(e, t);
                            case 3:
                                n(i, e, t);
                                break;
                            default:
                                return o
                        }
                    },
                    BYTE: function(t) {
                        return e(t, 1)
                    },
                    SHORT: function(t) {
                        return e(t, 2)
                    },
                    LONG: function(n, r) {
                        return r === t ? e(n, 4) : void i(n, r, 4)
                    },
                    SLONG: function(t) {
                        var n = e(t, 4);
                        return n > 2147483647 ? n - 4294967296 : n
                    },
                    STRING: function(t, n) {
                        var i = "";
                        for (n += t; n > t; t++)
                            i += String.fromCharCode(e(t, 1));
                        return i
                    }
                }
            }
        }),
        i(k, [P], function(e) {
            return function t(n) {
                var i = [], r, o, a, s = 0;
                if (r = new e,
                    r.init(n),
                    65496 === r.SHORT(0)) {
                    for (o = 2; o <= n.length; )
                        if (a = r.SHORT(o),
                            a >= 65488 && 65495 >= a)
                            o += 2;
                        else {
                            if (65498 === a || 65497 === a)
                                break;
                            s = r.SHORT(o + 2) + 2,
                                a >= 65505 && 65519 >= a && i.push({
                                hex: a,
                                name: "APP" + (15 & a),
                                start: o,
                                length: s,
                                segment: r.SEGMENT(o, s)
                            }),
                                o += s
                        }
                    return r.init(null),
                    {
                        headers: i,
                        restore: function(e) {
                            var t, n;
                            for (r.init(e),
                                     o = 65504 == r.SHORT(2) ? 4 + r.SHORT(4) : 2,
                                     n = 0,
                                     t = i.length; t > n; n++)
                                r.SEGMENT(o, 0, i[n].segment),
                                    o += i[n].length;
                            return e = r.SEGMENT(),
                                r.init(null),
                                e
                        },
                        strip: function(e) {
                            var n, i, o;
                            for (i = new t(e),
                                     n = i.headers,
                                     i.purge(),
                                     r.init(e),
                                     o = n.length; o--; )
                                r.SEGMENT(n[o].start, n[o].length, "");
                            return e = r.SEGMENT(),
                                r.init(null),
                                e
                        },
                        get: function(e) {
                            for (var t = [], n = 0, r = i.length; r > n; n++)
                                i[n].name === e.toUpperCase() && t.push(i[n].segment);
                            return t
                        },
                        set: function(e, t) {
                            var n = [], r, o, a;
                            for ("string" == typeof t ? n.push(t) : n = t,
                                     r = o = 0,
                                     a = i.length; a > r && (i[r].name === e.toUpperCase() && (i[r].segment = n[o],
                                i[r].length = n[o].length,
                                o++),
                                !(o >= n.length)); r++)
                                ;
                        },
                        purge: function() {
                            i = [],
                                r.init(null),
                                r = null
                        }
                    }
                }
            }
        }),
        i(U, [u, P], function(e, n) {
            return function i() {
                function i(e, n) {
                    var i = a.SHORT(e), r, o, s, u, d, f, h, p, m = [], g = {};
                    for (r = 0; i > r; r++)
                        if (h = f = e + 12 * r + 2,
                            s = n[a.SHORT(h)],
                            s !== t) {
                            switch (u = a.SHORT(h += 2),
                                d = a.LONG(h += 2),
                                h += 4,
                                m = [],
                                u) {
                                case 1:
                                case 7:
                                    for (d > 4 && (h = a.LONG(h) + c.tiffHeader),
                                             o = 0; d > o; o++)
                                        m[o] = a.BYTE(h + o);
                                    break;
                                case 2:
                                    d > 4 && (h = a.LONG(h) + c.tiffHeader),
                                        g[s] = a.STRING(h, d - 1);
                                    continue;
                                case 3:
                                    for (d > 2 && (h = a.LONG(h) + c.tiffHeader),
                                             o = 0; d > o; o++)
                                        m[o] = a.SHORT(h + 2 * o);
                                    break;
                                case 4:
                                    for (d > 1 && (h = a.LONG(h) + c.tiffHeader),
                                             o = 0; d > o; o++)
                                        m[o] = a.LONG(h + 4 * o);
                                    break;
                                case 5:
                                    for (h = a.LONG(h) + c.tiffHeader,
                                             o = 0; d > o; o++)
                                        m[o] = a.LONG(h + 4 * o) / a.LONG(h + 4 * o + 4);
                                    break;
                                case 9:
                                    for (h = a.LONG(h) + c.tiffHeader,
                                             o = 0; d > o; o++)
                                        m[o] = a.SLONG(h + 4 * o);
                                    break;
                                case 10:
                                    for (h = a.LONG(h) + c.tiffHeader,
                                             o = 0; d > o; o++)
                                        m[o] = a.SLONG(h + 4 * o) / a.SLONG(h + 4 * o + 4);
                                    break;
                                default:
                                    continue
                            }
                            p = 1 == d ? m[0] : m,
                                g[s] = l.hasOwnProperty(s) && "object" != typeof p ? l[s][p] : p
                        }
                    return g
                }
                function r() {
                    var e = c.tiffHeader;
                    return a.II(18761 == a.SHORT(e)),
                            42 !== a.SHORT(e += 2) ? !1 : (c.IFD0 = c.tiffHeader + a.LONG(e += 2),
                        u = i(c.IFD0, s.tiff),
                        "ExifIFDPointer"in u && (c.exifIFD = c.tiffHeader + u.ExifIFDPointer,
                        delete u.ExifIFDPointer),
                        "GPSInfoIFDPointer"in u && (c.gpsIFD = c.tiffHeader + u.GPSInfoIFDPointer,
                        delete u.GPSInfoIFDPointer),
                        !0)
                }
                function o(e, t, n) {
                    var i, r, o, u = 0;
                    if ("string" == typeof t) {
                        var l = s[e.toLowerCase()];
                        for (var d in l)
                            if (l[d] === t) {
                                t = d;
                                break
                            }
                    }
                    i = c[e.toLowerCase() + "IFD"],
                        r = a.SHORT(i);
                    for (var f = 0; r > f; f++)
                        if (o = i + 12 * f + 2,
                            a.SHORT(o) == t) {
                            u = o + 8;
                            break
                        }
                    return u ? (a.LONG(u, n),
                        !0) : !1
                }
                var a, s, u, c = {}, l;
                return a = new n,
                    s = {
                        tiff: {
                            274: "Orientation",
                            270: "ImageDescription",
                            271: "Make",
                            272: "Model",
                            305: "Software",
                            34665: "ExifIFDPointer",
                            34853: "GPSInfoIFDPointer"
                        },
                        exif: {
                            36864: "ExifVersion",
                            40961: "ColorSpace",
                            40962: "PixelXDimension",
                            40963: "PixelYDimension",
                            36867: "DateTimeOriginal",
                            33434: "ExposureTime",
                            33437: "FNumber",
                            34855: "ISOSpeedRatings",
                            37377: "ShutterSpeedValue",
                            37378: "ApertureValue",
                            37383: "MeteringMode",
                            37384: "LightSource",
                            37385: "Flash",
                            37386: "FocalLength",
                            41986: "ExposureMode",
                            41987: "WhiteBalance",
                            41990: "SceneCaptureType",
                            41988: "DigitalZoomRatio",
                            41992: "Contrast",
                            41993: "Saturation",
                            41994: "Sharpness"
                        },
                        gps: {
                            0: "GPSVersionID",
                            1: "GPSLatitudeRef",
                            2: "GPSLatitude",
                            3: "GPSLongitudeRef",
                            4: "GPSLongitude"
                        }
                    },
                    l = {
                        ColorSpace: {
                            1: "sRGB",
                            0: "Uncalibrated"
                        },
                        MeteringMode: {
                            0: "Unknown",
                            1: "Average",
                            2: "CenterWeightedAverage",
                            3: "Spot",
                            4: "MultiSpot",
                            5: "Pattern",
                            6: "Partial",
                            255: "Other"
                        },
                        LightSource: {
                            1: "Daylight",
                            2: "Fliorescent",
                            3: "Tungsten",
                            4: "Flash",
                            9: "Fine weather",
                            10: "Cloudy weather",
                            11: "Shade",
                            12: "Daylight fluorescent(D 5700-7100K)",
                            13: "Day white fluorescent(N 4600-5400K)",
                            14: "Cool white fluorescent(W 3900-4500K)",
                            15: "White fluorescent(WW 3200-3700K)",
                            17: "Standard light A",
                            18: "Standard light B",
                            19: "Standard light C",
                            20: "D55",
                            21: "D65",
                            22: "D75",
                            23: "D50",
                            24: "ISO studio tungsten",
                            255: "Other"
                        },
                        Flash: {
                            0: "Flash did not fire.",
                            1: "Flash fired.",
                            5: "Strobe return light not detected.",
                            7: "Strobe return light detected.",
                            9: "Flash fired,compulsory flash mode",
                            13: "Flash fired,compulsory flash mode,return light not detected",
                            15: "Flash fired,compulsory flash mode,return light detected",
                            16: "Flash did not fire,compulsory flash mode",
                            24: "Flash did not fire,auto mode",
                            25: "Flash fired,auto mode",
                            29: "Flash fired,auto mode,return light not detected",
                            31: "Flash fired,auto mode,return light detected",
                            32: "No flash function",
                            65: "Flash fired,red-eye reduction mode",
                            69: "Flash fired,red-eye reduction mode,return light not detected",
                            71: "Flash fired,red-eye reduction mode,return light detected",
                            73: "Flash fired,compulsory flash mode,red-eye reduction mode",
                            77: "Flash fired,compulsory flash mode,red-eye reduction mode,return light not detected",
                            79: "Flash fired,compulsory flash mode,red-eye reduction mode,return light detected",
                            89: "Flash fired,auto mode,red-eye reduction mode",
                            93: "Flash fired,auto mode,return light not detected,red-eye reduction mode",
                            95: "Flash fired,auto mode,return light detected,red-eye reduction mode"
                        },
                        ExposureMode: {
                            0: "Auto exposure",
                            1: "Manual exposure",
                            2: "Auto bracket"
                        },
                        WhiteBalance: {
                            0: "Auto white balance",
                            1: "Manual white balance"
                        },
                        SceneCaptureType: {
                            0: "Standard",
                            1: "Landscape",
                            2: "Portrait",
                            3: "Night scene"
                        },
                        Contrast: {
                            0: "Normal",
                            1: "Soft",
                            2: "Hard"
                        },
                        Saturation: {
                            0: "Normal",
                            1: "Low saturation",
                            2: "High saturation"
                        },
                        Sharpness: {
                            0: "Normal",
                            1: "Soft",
                            2: "Hard"
                        },
                        GPSLatitudeRef: {
                            N: "North latitude",
                            S: "South latitude"
                        },
                        GPSLongitudeRef: {
                            E: "East longitude",
                            W: "West longitude"
                        }
                    },
                {
                    init: function(e) {
                        return c = {
                            tiffHeader: 10
                        },
                                e !== t && e.length ? (a.init(e),
                                65505 === a.SHORT(0) && "EXIF\x00" === a.STRING(4, 5).toUpperCase() ? r() : !1) : !1
                    },
                    TIFF: function() {
                        return u
                    },
                    EXIF: function() {
                        var t;
                        if (t = i(c.exifIFD, s.exif),
                            t.ExifVersion && "array" === e.typeOf(t.ExifVersion)) {
                            for (var n = 0, r = ""; n < t.ExifVersion.length; n++)
                                r += String.fromCharCode(t.ExifVersion[n]);
                            t.ExifVersion = r
                        }
                        return t
                    },
                    GPS: function() {
                        var t;
                        return t = i(c.gpsIFD, s.gps),
                            t.GPSVersionID && "array" === e.typeOf(t.GPSVersionID) && (t.GPSVersionID = t.GPSVersionID.join(".")),
                            t
                    },
                    setExif: function(e, t) {
                        return "PixelXDimension" !== e && "PixelYDimension" !== e ? !1 : o("exif", e, t)
                    },
                    getBinary: function() {
                        return a.SEGMENT()
                    },
                    purge: function() {
                        a.init(null),
                            a = u = null,
                            c = {}
                    }
                }
            }
        }),
        i(B, [u, h, k, P, U], function(e, t, n, i, r) {
            function o(o) {
                function a() {
                    for (var e = 0, t, n; e <= u.length; ) {
                        if (t = c.SHORT(e += 2),
                            t >= 65472 && 65475 >= t)
                            return e += 5,
                            {
                                height: c.SHORT(e),
                                width: c.SHORT(e += 2)
                            };
                        n = c.SHORT(e += 2),
                            e += n - 2
                    }
                    return null
                }
                function s() {
                    d && l && c && (d.purge(),
                        l.purge(),
                        c.init(null),
                        u = f = l = d = c = null)
                }
                var u, c, l, d, f, h;
                if (u = o,
                    c = new i,
                    c.init(u),
                    65496 !== c.SHORT(0))
                    throw new t.ImageError(t.ImageError.WRONG_FORMAT);
                l = new n(o),
                    d = new r,
                    h = !!d.init(l.get("app1")[0]),
                    f = a.call(this),
                    e.extend(this, {
                        type: "image/jpeg",
                        size: u.length,
                        width: f && f.width || 0,
                        height: f && f.height || 0,
                        setExif: function(t, n) {
                            return h ? ("object" === e.typeOf(t) ? e.each(t, function(e, t) {
                                d.setExif(t, e)
                            }) : d.setExif(t, n),
                                void l.set("app1", d.getBinary())) : !1
                        },
                        writeHeaders: function() {
                            return arguments.length ? l.restore(arguments[0]) : u = l.restore(u)
                        },
                        stripHeaders: function(e) {
                            return l.strip(e)
                        },
                        purge: function() {
                            s.call(this)
                        }
                    }),
                    h && (this.meta = {
                    tiff: d.TIFF(),
                    exif: d.EXIF(),
                    gps: d.GPS()
                })
            }
            return o
        }),
        i(z, [h, u, P], function(e, t, n) {
            function i(i) {
                function r() {
                    var e, t;
                    return e = a.call(this, 8),
                            "IHDR" == e.type ? (t = e.start,
                    {
                        width: u.LONG(t),
                        height: u.LONG(t += 4)
                    }) : null
                }
                function o() {
                    u && (u.init(null),
                        s = d = c = l = u = null)
                }
                function a(e) {
                    var t, n, i, r;
                    return t = u.LONG(e),
                        n = u.STRING(e += 4, 4),
                        i = e += 4,
                        r = u.LONG(e + t),
                    {
                        length: t,
                        type: n,
                        start: i,
                        CRC: r
                    }
                }
                var s, u, c, l, d;
                s = i,
                    u = new n,
                    u.init(s),
                    function() {
                        var t = 0
                            , n = 0
                            , i = [35152, 20039, 3338, 6666];
                        for (n = 0; n < i.length; n++,
                            t += 2)
                            if (i[n] != u.SHORT(t))
                                throw new e.ImageError(e.ImageError.WRONG_FORMAT)
                    }(),
                    d = r.call(this),
                    t.extend(this, {
                        type: "image/png",
                        size: s.length,
                        width: d.width,
                        height: d.height,
                        purge: function() {
                            o.call(this)
                        }
                    }),
                    o.call(this)
            }
            return i
        }),
        i(G, [u, h, B, z], function(e, t, n, i) {
            return function(r) {
                var o = [n, i], a;
                a = function() {
                    for (var e = 0; e < o.length; e++)
                        try {
                            return new o[e](r)
                        } catch (n) {}
                    throw new t.ImageError(t.ImageError.WRONG_FORMAT)
                }(),
                    e.extend(this, {
                        type: "",
                        size: 0,
                        width: 0,
                        height: 0,
                        setExif: function() {},
                        writeHeaders: function(e) {
                            return e
                        },
                        stripHeaders: function(e) {
                            return e
                        },
                        purge: function() {}
                    }),
                    e.extend(this, a),
                    this.purge = function() {
                        a.purge(),
                            a = null
                    }
            }
        }),
        i(q, [], function() {
            function e(e, i, r) {
                var o = e.naturalWidth
                    , a = e.naturalHeight
                    , s = r.width
                    , u = r.height
                    , c = r.x || 0
                    , l = r.y || 0
                    , d = i.getContext("2d");
                t(e) && (o /= 2,
                    a /= 2);
                var f = 1024
                    , h = document.createElement("canvas");
                h.width = h.height = f;
                for (var p = h.getContext("2d"), m = n(e, o, a), g = 0; a > g; ) {
                    for (var v = g + f > a ? a - g : f, y = 0; o > y; ) {
                        var w = y + f > o ? o - y : f;
                        p.clearRect(0, 0, f, f),
                            p.drawImage(e, -y, -g);
                        var E = y * s / o + c << 0
                            , _ = Math.ceil(w * s / o)
                            , x = g * u / a / m + l << 0
                            , b = Math.ceil(v * u / a / m);
                        d.drawImage(h, 0, 0, w, v, E, x, _, b),
                            y += f
                    }
                    g += f
                }
                h = p = null
            }
            function t(e) {
                var t = e.naturalWidth
                    , n = e.naturalHeight;
                if (t * n > 1048576) {
                    var i = document.createElement("canvas");
                    i.width = i.height = 1;
                    var r = i.getContext("2d");
                    return r.drawImage(e, -t + 1, 0),
                        0 === r.getImageData(0, 0, 1, 1).data[3]
                }
                return !1
            }
            function n(e, t, n) {
                var i = document.createElement("canvas");
                i.width = 1,
                    i.height = n;
                var r = i.getContext("2d");
                r.drawImage(e, 0, 0);
                for (var o = r.getImageData(0, 0, 1, n).data, a = 0, s = n, u = n; u > a; ) {
                    var c = o[4 * (u - 1) + 3];
                    0 === c ? s = u : a = u,
                        u = s + a >> 1
                }
                i = null;
                var l = u / n;
                return 0 === l ? 1 : l
            }
            return {
                isSubsampled: t,
                renderTo: e
            }
        }),
        i(X, [D, u, h, m, w, G, q, l, d], function(e, t, n, i, r, o, a, s, u) {
            function c() {
                function e() {
                    if (!E && !y)
                        throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);
                    return E || y
                }
                function c(e) {
                    return i.atob(e.substring(e.indexOf("base64,") + 7))
                }
                function l(e, t) {
                    return "data:" + (t || "") + ";base64," + i.btoa(e)
                }
                function d(e) {
                    var t = this;
                    y = new Image,
                        y.onerror = function() {
                            g.call(this),
                                t.trigger("error", n.ImageError.WRONG_FORMAT)
                        }
                        ,
                        y.onload = function() {
                            t.trigger("load")
                        }
                        ,
                        y.src = /^data:[^;]*;base64,/.test(e) ? e : l(e, x.type)
                }
                function f(e, t) {
                    var i = this, r;
                    return window.FileReader ? (r = new FileReader,
                        r.onload = function() {
                            t(this.result)
                        }
                        ,
                        r.onerror = function() {
                            i.trigger("error", n.ImageError.WRONG_FORMAT)
                        }
                        ,
                        r.readAsDataURL(e),
                        void 0) : t(e.getAsDataURL())
                }
                function h(n, i, r, o) {
                    var a = this, s, u, c = 0, l = 0, d, f, h, g;
                    if (R = o,
                        g = this.meta && this.meta.tiff && this.meta.tiff.Orientation || 1,
                        -1 !== t.inArray(g, [5, 6, 7, 8])) {
                        var v = n;
                        n = i,
                            i = v
                    }
                    return d = e(),
                        r ? (n = Math.min(n, d.width),
                            i = Math.min(i, d.height),
                            s = Math.max(n / d.width, i / d.height)) : s = Math.min(n / d.width, i / d.height),
                            s > 1 && !r && o ? void this.trigger("Resize") : (E || (E = document.createElement("canvas")),
                        f = Math.round(d.width * s),
                        h = Math.round(d.height * s),
                        r ? (E.width = n,
                            E.height = i,
                            f > n && (c = Math.round((f - n) / 2)),
                            h > i && (l = Math.round((h - i) / 2))) : (E.width = f,
                            E.height = h),
                        R || m(E.width, E.height, g),
                        p.call(this, d, E, -c, -l, f, h),
                        this.width = E.width,
                        this.height = E.height,
                        b = !0,
                        void a.trigger("Resize"))
                }
                function p(e, t, n, i, r, o) {
                    if ("iOS" === u.OS)
                        a.renderTo(e, t, {
                            width: r,
                            height: o,
                            x: n,
                            y: i
                        });
                    else {
                        var s = t.getContext("2d");
                        s.drawImage(e, n, i, r, o)
                    }
                }
                function m(e, t, n) {
                    switch (n) {
                        case 5:
                        case 6:
                        case 7:
                        case 8:
                            E.width = t,
                                E.height = e;
                            break;
                        default:
                            E.width = e,
                                E.height = t
                    }
                    var i = E.getContext("2d");
                    switch (n) {
                        case 2:
                            i.translate(e, 0),
                                i.scale(-1, 1);
                            break;
                        case 3:
                            i.translate(e, t),
                                i.rotate(Math.PI);
                            break;
                        case 4:
                            i.translate(0, t),
                                i.scale(1, -1);
                            break;
                        case 5:
                            i.rotate(.5 * Math.PI),
                                i.scale(1, -1);
                            break;
                        case 6:
                            i.rotate(.5 * Math.PI),
                                i.translate(0, -t);
                            break;
                        case 7:
                            i.rotate(.5 * Math.PI),
                                i.translate(e, -t),
                                i.scale(-1, 1);
                            break;
                        case 8:
                            i.rotate(-.5 * Math.PI),
                                i.translate(-e, 0)
                    }
                }
                function g() {
                    w && (w.purge(),
                        w = null),
                        _ = y = E = x = null,
                        b = !1
                }
                var v = this, y, w, E, _, x, b = !1, R = !0;
                t.extend(this, {
                    loadFromBlob: function(e) {
                        var t = this
                            , i = t.getRuntime()
                            , r = arguments.length > 1 ? arguments[1] : !0;
                        if (!i.can("access_binary"))
                            throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);
                        return x = e,
                            e.isDetached() ? (_ = e.getSource(),
                                void d.call(this, _)) : void f.call(this, e.getSource(), function(e) {
                                r && (_ = c(e)),
                                    d.call(t, e)
                            })
                    },
                    loadFromImage: function(e, t) {
                        this.meta = e.meta,
                            x = new r(null,{
                                name: e.name,
                                size: e.size,
                                type: e.type
                            }),
                            d.call(this, t ? _ = e.getAsBinaryString() : e.getAsDataURL())
                    },
                    getInfo: function() {
                        var t = this.getRuntime(), n;
                        return !w && _ && t.can("access_image_binary") && (w = new o(_)),
                            n = {
                                width: e().width || 0,
                                height: e().height || 0,
                                type: x.type || s.getFileMime(x.name),
                                size: _ && _.length || x.size || 0,
                                name: x.name || "",
                                meta: w && w.meta || this.meta || {}
                            }
                    },
                    downsize: function() {
                        h.apply(this, arguments)
                    },
                    getAsCanvas: function() {
                        return E && (E.id = this.uid + "_canvas"),
                            E
                    },
                    getAsBlob: function(e, t) {
                        return e !== this.type && h.call(this, this.width, this.height, !1),
                            new r(null,{
                                name: x.name || "",
                                type: e,
                                data: v.getAsBinaryString.call(this, e, t)
                            })
                    },
                    getAsDataURL: function(e) {
                        var t = arguments[1] || 90;
                        if (!b)
                            return y.src;
                        if ("image/jpeg" !== e)
                            return E.toDataURL("image/png");
                        try {
                            return E.toDataURL("image/jpeg", t / 100)
                        } catch (n) {
                            return E.toDataURL("image/jpeg")
                        }
                    },
                    getAsBinaryString: function(e, t) {
                        if (!b)
                            return _ || (_ = c(v.getAsDataURL(e, t))),
                                _;
                        if ("image/jpeg" !== e)
                            _ = c(v.getAsDataURL(e, t));
                        else {
                            var n;
                            t || (t = 90);
                            try {
                                n = E.toDataURL("image/jpeg", t / 100)
                            } catch (i) {
                                n = E.toDataURL("image/jpeg")
                            }
                            _ = c(n),
                                w && (_ = w.stripHeaders(_),
                                R && (w.meta && w.meta.exif && w.setExif({
                                PixelXDimension: this.width,
                                PixelYDimension: this.height
                            }),
                                _ = w.writeHeaders(_)),
                                w.purge(),
                                w = null)
                        }
                        return b = !1,
                            _
                    },
                    destroy: function() {
                        v = null,
                            g.call(this),
                            this.getRuntime().getShim().removeInstance(this.uid)
                    }
                })
            }
            return e.Image = c
        }),
        i(j, [u, d, f, h, g], function(e, t, n, i, r) {
            function o() {
                var e;
                try {
                    e = navigator.plugins["Shockwave Flash"],
                        e = e.description
                } catch (t) {
                    try {
                        e = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")
                    } catch (n) {
                        e = "0.0"
                    }
                }
                return e = e.match(/\d+/g),
                    parseFloat(e[0] + "." + e[1])
            }
            function a(a) {
                var c = this, l;
                a = e.extend({
                    swf_url: t.swf_url
                }, a),
                    r.call(this, a, s, {
                        access_binary: function(e) {
                            return e && "browser" === c.mode
                        },
                        access_image_binary: function(e) {
                            return e && "browser" === c.mode
                        },
                        display_media: r.capTrue,
                        do_cors: r.capTrue,
                        drag_and_drop: !1,
                        report_upload_progress: function() {
                            return "client" === c.mode
                        },
                        resize_image: r.capTrue,
                        return_response_headers: !1,
                        return_response_type: function(t) {
                            return "json" === t && window.JSON ? !0 : !e.arrayDiff(t, ["", "text", "document"]) || "browser" === c.mode
                        },
                        return_status_code: function(t) {
                            return "browser" === c.mode || !e.arrayDiff(t, [200, 404])
                        },
                        select_file: r.capTrue,
                        select_multiple: r.capTrue,
                        send_binary_string: function(e) {
                            return e && "browser" === c.mode
                        },
                        send_browser_cookies: function(e) {
                            return e && "browser" === c.mode
                        },
                        send_custom_headers: function(e) {
                            return e && "browser" === c.mode
                        },
                        send_multipart: r.capTrue,
                        slice_blob: function(e) {
                            return e && "browser" === c.mode
                        },
                        stream_upload: function(e) {
                            return e && "browser" === c.mode
                        },
                        summon_file_dialog: !1,
                        upload_filesize: function(t) {
                            return e.parseSizeStr(t) <= 2097152 || "client" === c.mode
                        },
                        use_http_method: function(t) {
                            return !e.arrayDiff(t, ["GET", "POST"])
                        }
                    }, {
                        access_binary: function(e) {
                            return e ? "browser" : "client"
                        },
                        access_image_binary: function(e) {
                            return e ? "browser" : "client"
                        },
                        report_upload_progress: function(e) {
                            return e ? "browser" : "client"
                        },
                        return_response_type: function(t) {
                            return e.arrayDiff(t, ["", "text", "json", "document"]) ? "browser" : ["client", "browser"]
                        },
                        return_status_code: function(t) {
                            return e.arrayDiff(t, [200, 404]) ? "browser" : ["client", "browser"]
                        },
                        send_binary_string: function(e) {
                            return e ? "browser" : "client"
                        },
                        send_browser_cookies: function(e) {
                            return e ? "browser" : "client"
                        },
                        send_custom_headers: function(e) {
                            return e ? "browser" : "client"
                        },
                        stream_upload: function(e) {
                            return e ? "client" : "browser"
                        },
                        upload_filesize: function(t) {
                            return e.parseSizeStr(t) >= 2097152 ? "client" : "browser"
                        }
                    }, "client"),
                    o() < 10 && (this.mode = !1),
                    e.extend(this, {
                        getShim: function() {
                            return n.get(this.uid)
                        },
                        shimExec: function(e, t) {
                            var n = [].slice.call(arguments, 2);
                            return c.getShim().exec(this.uid, e, t, n)
                        },
                        init: function() {
                            var n, r, o;
                            o = this.getShimContainer(),
                                e.extend(o.style, {
                                    position: "absolute",
                                    top: "-8px",
                                    left: "-8px",
                                    width: "9px",
                                    height: "9px",
                                    overflow: "hidden"
                                }),
                                n = '<object id="' + this.uid + '" type="application/x-shockwave-flash" data="' + a.swf_url + '" ',
                                "IE" === t.browser && (n += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),
                                n += 'width="100%" height="100%" style="outline:0"><param name="movie" value="' + a.swf_url + '" /><param name="flashvars" value="uid=' + escape(this.uid) + "&target=" + t.global_event_dispatcher + '" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>',
                                    "IE" === t.browser ? (r = document.createElement("div"),
                                o.appendChild(r),
                                r.outerHTML = n,
                                r = o = null) : o.innerHTML = n,
                                l = setTimeout(function() {
                                    c && !c.initialized && c.trigger("Error", new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))
                                }, 5e3)
                        },
                        destroy: function(e) {
                            return function() {
                                e.call(c),
                                    clearTimeout(l),
                                    a = l = e = c = null
                            }
                        }(this.destroy)
                    }, u)
            }
            var s = "flash"
                , u = {};
            return r.addConstructor(s, a),
                u
        }),
        i(V, [j, y], function(e, t) {
            var n = {
                slice: function(e, n, i, r) {
                    var o = this.getRuntime();
                    return 0 > n ? n = Math.max(e.size + n, 0) : n > 0 && (n = Math.min(n, e.size)),
                            0 > i ? i = Math.max(e.size + i, 0) : i > 0 && (i = Math.min(i, e.size)),
                        e = o.shimExec.call(this, "Blob", "slice", n, i, r || ""),
                        e && (e = new t(o.uid,e)),
                        e
                }
            };
            return e.Blob = n
        }),
        i(W, [j], function(e) {
            var t = {
                init: function(e) {
                    this.getRuntime().shimExec.call(this, "FileInput", "init", {
                        name: e.name,
                        accept: e.accept,
                        multiple: e.multiple
                    }),
                        this.trigger("ready")
                }
            };
            return e.FileInput = t
        }),
        i(Y, [j, m], function(e, t) {
            function n(e, n) {
                switch (n) {
                    case "readAsText":
                        return t.atob(e, "utf8");
                    case "readAsBinaryString":
                        return t.atob(e);
                    case "readAsDataURL":
                        return e
                }
                return null
            }
            var i = ""
                , r = {
                    read: function(e, t) {
                        var r = this
                            , o = r.getRuntime();
                        return "readAsDataURL" === e && (i = "data:" + (t.type || "") + ";base64,"),
                            r.bind("Progress", function(t, r) {
                                r && (i += n(r, e))
                            }),
                            o.shimExec.call(this, "FileReader", "readAsBase64", t.uid)
                    },
                    getResult: function() {
                        return i
                    },
                    destroy: function() {
                        i = null
                    }
                };
            return e.FileReader = r
        }),
        i($, [j, m], function(e, t) {
            function n(e, n) {
                switch (n) {
                    case "readAsText":
                        return t.atob(e, "utf8");
                    case "readAsBinaryString":
                        return t.atob(e);
                    case "readAsDataURL":
                        return e
                }
                return null
            }
            var i = {
                read: function(e, t) {
                    var i, r = this.getRuntime();
                    return (i = r.shimExec.call(this, "FileReaderSync", "readAsBase64", t.uid)) ? ("readAsDataURL" === e && (i = "data:" + (t.type || "") + ";base64," + i),
                        n(i, e, t.type)) : null
                }
            };
            return e.FileReaderSync = i
        }),
        i(J, [j, u, y, w, T, A, O], function(e, t, n, i, r, o, a) {
            var s = {
                send: function(e, i) {
                    function r() {
                        e.transport = l.mode,
                            l.shimExec.call(c, "XMLHttpRequest", "send", e, i)
                    }
                    function s(e, t) {
                        l.shimExec.call(c, "XMLHttpRequest", "appendBlob", e, t.uid),
                            i = null,
                            r()
                    }
                    function u(e, t) {
                        var n = new a;
                        n.bind("TransportingComplete", function() {
                            t(this.result)
                        }),
                            n.transport(e.getSource(), e.type, {
                                ruid: l.uid
                            })
                    }
                    var c = this
                        , l = c.getRuntime();
                    if (t.isEmptyObj(e.headers) || t.each(e.headers, function(e, t) {
                        l.shimExec.call(c, "XMLHttpRequest", "setRequestHeader", t, e.toString())
                    }),
                        i instanceof o) {
                        var d;
                        if (i.each(function(e, t) {
                            e instanceof n ? d = t : l.shimExec.call(c, "XMLHttpRequest", "append", t, e)
                        }),
                            i.hasBlob()) {
                            var f = i.getBlob();
                            f.isDetached() ? u(f, function(e) {
                                f.destroy(),
                                    s(d, e)
                            }) : s(d, f)
                        } else
                            i = null,
                                r()
                    } else
                        i instanceof n ? i.isDetached() ? u(i, function(e) {
                            i.destroy(),
                                i = e.uid,
                                r()
                        }) : (i = i.uid,
                            r()) : r()
                },
                getResponse: function(e) {
                    var n, o, a = this.getRuntime();
                    if (o = a.shimExec.call(this, "XMLHttpRequest", "getResponseAsBlob")) {
                        if (o = new i(a.uid,o),
                            "blob" === e)
                            return o;
                        try {
                            if (n = new r,
                                ~t.inArray(e, ["", "text"]))
                                return n.readAsText(o);
                            if ("json" === e && window.JSON)
                                return JSON.parse(n.readAsText(o))
                        } finally {
                            o.destroy()
                        }
                    }
                    return null
                },
                abort: function(e) {
                    var t = this.getRuntime();
                    t.shimExec.call(this, "XMLHttpRequest", "abort"),
                        this.dispatchEvent("readystatechange"),
                        this.dispatchEvent("abort")
                }
            };
            return e.XMLHttpRequest = s
        }),
        i(Z, [j, y], function(e, t) {
            var n = {
                getAsBlob: function(e) {
                    var n = this.getRuntime()
                        , i = n.shimExec.call(this, "Transporter", "getAsBlob", e);
                    return i ? new t(n.uid,i) : null
                }
            };
            return e.Transporter = n
        }),
        i(K, [j, u, O, y, T], function(e, t, n, i, r) {
            var o = {
                loadFromBlob: function(e) {
                    function t(e) {
                        r.shimExec.call(i, "Image", "loadFromBlob", e.uid),
                            i = r = null
                    }
                    var i = this
                        , r = i.getRuntime();
                    if (e.isDetached()) {
                        var o = new n;
                        o.bind("TransportingComplete", function() {
                            t(o.result.getSource())
                        }),
                            o.transport(e.getSource(), e.type, {
                                ruid: r.uid
                            })
                    } else
                        t(e.getSource())
                },
                loadFromImage: function(e) {
                    var t = this.getRuntime();
                    return t.shimExec.call(this, "Image", "loadFromImage", e.uid)
                },
                getAsBlob: function(e, t) {
                    var n = this.getRuntime()
                        , r = n.shimExec.call(this, "Image", "getAsBlob", e, t);
                    return r ? new i(n.uid,r) : null
                },
                getAsDataURL: function() {
                    var e = this.getRuntime(), t = e.Image.getAsBlob.apply(this, arguments), n;
                    return t ? (n = new r,
                        n.readAsDataURL(t)) : null
                }
            };
            return e.Image = o
        }),
        i(Q, [u, d, f, h, g], function(e, t, n, i, r) {
            function o(e) {
                var t = !1, n = null, i, r, o, a, s, u = 0;
                try {
                    try {
                        n = new ActiveXObject("AgControl.AgControl"),
                            n.IsVersionSupported(e) && (t = !0),
                            n = null
                    } catch (c) {
                        var l = navigator.plugins["Silverlight Plug-In"];
                        if (l) {
                            for (i = l.description,
                                     "1.0.30226.2" === i && (i = "2.0.30226.2"),
                                     r = i.split("."); r.length > 3; )
                                r.pop();
                            for (; r.length < 4; )
                                r.push(0);
                            for (o = e.split("."); o.length > 4; )
                                o.pop();
                            do
                                a = parseInt(o[u], 10),
                                    s = parseInt(r[u], 10),
                                    u++;
                            while (u < o.length && a === s);s >= a && !isNaN(a) && (t = !0)
                        }
                    }
                } catch (d) {
                    t = !1
                }
                return t
            }
            function a(a) {
                var c = this, l;
                a = e.extend({
                    xap_url: t.xap_url
                }, a),
                    r.call(this, a, s, {
                        access_binary: r.capTrue,
                        access_image_binary: r.capTrue,
                        display_media: r.capTrue,
                        do_cors: r.capTrue,
                        drag_and_drop: !1,
                        report_upload_progress: r.capTrue,
                        resize_image: r.capTrue,
                        return_response_headers: function(e) {
                            return e && "client" === c.mode
                        },
                        return_response_type: function(e) {
                            return "json" !== e ? !0 : !!window.JSON
                        },
                        return_status_code: function(t) {
                            return "client" === c.mode || !e.arrayDiff(t, [200, 404])
                        },
                        select_file: r.capTrue,
                        select_multiple: r.capTrue,
                        send_binary_string: r.capTrue,
                        send_browser_cookies: function(e) {
                            return e && "browser" === c.mode
                        },
                        send_custom_headers: function(e) {
                            return e && "client" === c.mode
                        },
                        send_multipart: r.capTrue,
                        slice_blob: r.capTrue,
                        stream_upload: !0,
                        summon_file_dialog: !1,
                        upload_filesize: r.capTrue,
                        use_http_method: function(t) {
                            return "client" === c.mode || !e.arrayDiff(t, ["GET", "POST"])
                        }
                    }, {
                        return_response_headers: function(e) {
                            return e ? "client" : "browser"
                        },
                        return_status_code: function(t) {
                            return e.arrayDiff(t, [200, 404]) ? "client" : ["client", "browser"]
                        },
                        send_browser_cookies: function(e) {
                            return e ? "browser" : "client"
                        },
                        send_custom_headers: function(e) {
                            return e ? "client" : "browser"
                        },
                        use_http_method: function(t) {
                            return e.arrayDiff(t, ["GET", "POST"]) ? "client" : ["client", "browser"]
                        }
                    }),
                    o("2.0.31005.0") && "Opera" !== t.browser || (this.mode = !1),
                    e.extend(this, {
                        getShim: function() {
                            return n.get(this.uid).content.Moxie
                        },
                        shimExec: function(e, t) {
                            var n = [].slice.call(arguments, 2);
                            return c.getShim().exec(this.uid, e, t, n)
                        },
                        init: function() {
                            var e;
                            e = this.getShimContainer(),
                                e.innerHTML = '<object id="' + this.uid + '" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;"><param name="source" value="' + a.xap_url + '"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="enablehtmlaccess" value="true"/><param name="initParams" value="uid=' + this.uid + ",target=" + t.global_event_dispatcher + '"/></object>',
                                l = setTimeout(function() {
                                    c && !c.initialized && c.trigger("Error", new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))
                                }, "Windows" !== t.OS ? 1e4 : 5e3)
                        },
                        destroy: function(e) {
                            return function() {
                                e.call(c),
                                    clearTimeout(l),
                                    a = l = e = c = null
                            }
                        }(this.destroy)
                    }, u)
            }
            var s = "silverlight"
                , u = {};
            return r.addConstructor(s, a),
                u
        }),
        i(et, [Q, u, V], function(e, t, n) {
            return e.Blob = t.extend({}, n)
        }),
        i(tt, [Q], function(e) {
            var t = {
                init: function(e) {
                    function t(e) {
                        for (var t = "", n = 0; n < e.length; n++)
                            t += ("" !== t ? "|" : "") + e[n].title + " | *." + e[n].extensions.replace(/,/g, ";*.");
                        return t
                    }
                    this.getRuntime().shimExec.call(this, "FileInput", "init", t(e.accept), e.name, e.multiple),
                        this.trigger("ready")
                }
            };
            return e.FileInput = t
        }),
        i(nt, [Q, f, L], function(e, t, n) {
            var i = {
                init: function() {
                    var e = this, i = e.getRuntime(), r;
                    return r = i.getShimContainer(),
                        n.addEvent(r, "dragover", function(e) {
                            e.preventDefault(),
                                e.stopPropagation(),
                                e.dataTransfer.dropEffect = "copy"
                        }, e.uid),
                        n.addEvent(r, "dragenter", function(e) {
                            e.preventDefault();
                            var n = t.get(i.uid).dragEnter(e);
                            n && e.stopPropagation()
                        }, e.uid),
                        n.addEvent(r, "drop", function(e) {
                            e.preventDefault();
                            var n = t.get(i.uid).dragDrop(e);
                            n && e.stopPropagation()
                        }, e.uid),
                        i.shimExec.call(this, "FileDrop", "init")
                }
            };
            return e.FileDrop = i
        }),
        i(it, [Q, u, Y], function(e, t, n) {
            return e.FileReader = t.extend({}, n)
        }),
        i(rt, [Q, u, $], function(e, t, n) {
            return e.FileReaderSync = t.extend({}, n)
        }),
        i(ot, [Q, u, J], function(e, t, n) {
            return e.XMLHttpRequest = t.extend({}, n)
        }),
        i(at, [Q, u, Z], function(e, t, n) {
            return e.Transporter = t.extend({}, n)
        }),
        i(st, [Q, u, K], function(e, t, n) {
            return e.Image = t.extend({}, n, {
                getInfo: function() {
                    var e = this.getRuntime()
                        , n = ["tiff", "exif", "gps"]
                        , i = {
                            meta: {}
                        }
                        , r = e.shimExec.call(this, "Image", "getInfo");
                    return r.meta && t.each(n, function(e) {
                        var t = r.meta[e], n, o, a, s;
                        if (t && t.keys)
                            for (i.meta[e] = {},
                                     o = 0,
                                     a = t.keys.length; a > o; o++)
                                n = t.keys[o],
                                    s = t[n],
                                    s && (/^(\d|[1-9]\d+)$/.test(s) ? s = parseInt(s, 10) : /^\d*\.\d+$/.test(s) && (s = parseFloat(s)),
                                    i.meta[e][n] = s)
                    }),
                        i.width = parseInt(r.width, 10),
                        i.height = parseInt(r.height, 10),
                        i.size = parseInt(r.size, 10),
                        i.type = r.type,
                        i.name = r.name,
                        i
                }
            })
        }),
        i(ut, [u, h, g, d], function(e, t, n, i) {
            function r(t) {
                var r = this
                    , s = n.capTest
                    , u = n.capTrue;
                n.call(this, t, o, {
                    access_binary: s(window.FileReader || window.File && File.getAsDataURL),
                    access_image_binary: !1,
                    display_media: s(a.Image && (i.can("create_canvas") || i.can("use_data_uri_over32kb"))),
                    do_cors: !1,
                    drag_and_drop: !1,
                    filter_by_extension: s(function() {
                        return "Chrome" === i.browser && i.version >= 28 || "IE" === i.browser && i.version >= 10
                    }()),
                    resize_image: function() {
                        return a.Image && r.can("access_binary") && i.can("create_canvas")
                    },
                    report_upload_progress: !1,
                    return_response_headers: !1,
                    return_response_type: function(t) {
                        return "json" === t && window.JSON ? !0 : !!~e.inArray(t, ["text", "document", ""])
                    },
                    return_status_code: function(t) {
                        return !e.arrayDiff(t, [200, 404])
                    },
                    select_file: function() {
                        return i.can("use_fileinput")
                    },
                    select_multiple: !1,
                    send_binary_string: !1,
                    send_custom_headers: !1,
                    send_multipart: !0,
                    slice_blob: !1,
                    stream_upload: function() {
                        return r.can("select_file")
                    },
                    summon_file_dialog: s(function() {
                        return "Firefox" === i.browser && i.version >= 4 || "Opera" === i.browser && i.version >= 12 || !!~e.inArray(i.browser, ["Chrome", "Safari"])
                    }()),
                    upload_filesize: u,
                    use_http_method: function(t) {
                        return !e.arrayDiff(t, ["GET", "POST"])
                    }
                }),
                    e.extend(this, {
                        init: function() {
                            this.trigger("Init")
                        },
                        destroy: function(e) {
                            return function() {
                                e.call(r),
                                    e = r = null
                            }
                        }(this.destroy)
                    }),
                    e.extend(this.getShim(), a)
            }
            var o = "html4"
                , a = {};
            return n.addConstructor(o, r),
                a
        }),
        i(ct, [ut, u, f, L, l, d], function(e, t, n, i, r, o) {
            function a() {
                function e() {
                    var r = this, l = r.getRuntime(), d, f, h, p, m, g;
                    g = t.guid("uid_"),
                        d = l.getShimContainer(),
                        a && (h = n.get(a + "_form"),
                        h && t.extend(h.style, {
                        top: "100%"
                    })),
                        p = document.createElement("form"),
                        p.setAttribute("id", g + "_form"),
                        p.setAttribute("method", "post"),
                        p.setAttribute("enctype", "multipart/form-data"),
                        p.setAttribute("encoding", "multipart/form-data"),
                        t.extend(p.style, {
                            overflow: "hidden",
                            position: "absolute",
                            top: 0,
                            left: 0,
                            width: "100%",
                            height: "100%"
                        }),
                        m = document.createElement("input"),
                        m.setAttribute("id", g),
                        m.setAttribute("type", "file"),
                        m.setAttribute("name", c.name || "Filedata"),
                        m.setAttribute("accept", u.join(",")),
                        t.extend(m.style, {
                            fontSize: "999px",
                            opacity: 0
                        }),
                        p.appendChild(m),
                        d.appendChild(p),
                        t.extend(m.style, {
                            position: "absolute",
                            top: 0,
                            left: 0,
                            width: "100%",
                            height: "100%"
                        }),
                        "IE" === o.browser && o.version < 10 && t.extend(m.style, {
                        filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=0)"
                    }),
                        m.onchange = function() {
                            var t;
                            this.value && (t = this.files ? this.files[0] : {
                                name: this.value
                            },
                                s = [t],
                                this.onchange = function() {}
                                ,
                                e.call(r),
                                r.bind("change", function i() {
                                    var e = n.get(g), t = n.get(g + "_form"), o;
                                    r.unbind("change", i),
                                        r.files.length && e && t && (o = r.files[0],
                                        e.setAttribute("id", o.uid),
                                        t.setAttribute("id", o.uid + "_form"),
                                        t.setAttribute("target", o.uid + "_iframe")),
                                        e = t = null
                                }, 998),
                                m = p = null,
                                r.trigger("change"))
                        }
                        ,
                        l.can("summon_file_dialog") && (f = n.get(c.browse_button),
                        i.removeEvent(f, "click", r.uid),
                        i.addEvent(f, "click", function(e) {
                            m && !m.disabled && m.click(),
                                e.preventDefault()
                        }, r.uid)),
                        a = g,
                        d = h = f = null
                }
                var a, s = [], u = [], c;
                t.extend(this, {
                    init: function(t) {
                        var o = this, a = o.getRuntime(), s;
                        c = t,
                            u = t.accept.mimes || r.extList2mimes(t.accept, a.can("filter_by_extension")),
                            s = a.getShimContainer(),
                            function() {
                                var e, r, u;
                                e = n.get(t.browse_button),
                                    a.can("summon_file_dialog") && ("static" === n.getStyle(e, "position") && (e.style.position = "relative"),
                                    r = parseInt(n.getStyle(e, "z-index"), 10) || 1,
                                    e.style.zIndex = r,
                                    s.style.zIndex = r - 1),
                                    u = a.can("summon_file_dialog") ? e : s,
                                    i.addEvent(u, "mouseover", function() {
                                        o.trigger("mouseenter")
                                    }, o.uid),
                                    i.addEvent(u, "mouseout", function() {
                                        o.trigger("mouseleave")
                                    }, o.uid),
                                    i.addEvent(u, "mousedown", function() {
                                        o.trigger("mousedown")
                                    }, o.uid),
                                    i.addEvent(n.get(t.container), "mouseup", function() {
                                        o.trigger("mouseup")
                                    }, o.uid),
                                    e = null
                            }(),
                            e.call(this),
                            s = null,
                            o.trigger({
                                type: "ready",
                                async: !0
                            })
                    },
                    getFiles: function() {
                        return s
                    },
                    disable: function(e) {
                        var t;
                        (t = n.get(a)) && (t.disabled = !!e)
                    },
                    destroy: function() {
                        var e = this.getRuntime()
                            , t = e.getShim()
                            , r = e.getShimContainer();
                        i.removeAllEvents(r, this.uid),
                            i.removeAllEvents(c && n.get(c.container), this.uid),
                            i.removeAllEvents(c && n.get(c.browse_button), this.uid),
                            r && (r.innerHTML = ""),
                            t.removeInstance(this.uid),
                            a = s = u = c = r = t = null
                    }
                })
            }
            return e.FileInput = a
        }),
        i(lt, [ut, F], function(e, t) {
            return e.FileReader = t
        }),
        i(dt, [ut, u, f, R, h, L, y, A], function(e, t, n, i, r, o, a, s) {
            function u() {
                function e(e) {
                    var t = this, i, r, a, s, u = !1;
                    if (l) {
                        if (i = l.id.replace(/_iframe$/, ""),
                            r = n.get(i + "_form")) {
                            for (a = r.getElementsByTagName("input"),
                                     s = a.length; s--; )
                                switch (a[s].getAttribute("type")) {
                                    case "hidden":
                                        a[s].parentNode.removeChild(a[s]);
                                        break;
                                    case "file":
                                        u = !0
                                }
                            a = [],
                                u || r.parentNode.removeChild(r),
                                r = null
                        }
                        setTimeout(function() {
                            o.removeEvent(l, "load", t.uid),
                                l.parentNode && l.parentNode.removeChild(l);
                            var n = t.getRuntime().getShimContainer();
                            n.children.length || n.parentNode.removeChild(n),
                                n = l = null,
                                e()
                        }, 1)
                    }
                }
                var u, c, l;
                t.extend(this, {
                    send: function(d, f) {
                        function h() {
                            var n = m.getShimContainer() || document.body
                                , r = document.createElement("div");
                            r.innerHTML = '<iframe id="' + g + '_iframe" name="' + g + '_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>',
                                l = r.firstChild,
                                n.appendChild(l),
                                o.addEvent(l, "load", function() {
                                    var n;
                                    try {
                                        n = l.contentWindow.document || l.contentDocument || window.frames[l.id].document,
                                            /^4(0[0-9]|1[0-7]|2[2346])\s/.test(n.title) ? u = n.title.replace(/^(\d+).*$/, "$1") : (u = 200,
                                                c = t.trim(n.body.innerHTML),
                                                p.trigger({
                                                    type: "progress",
                                                    loaded: c.length,
                                                    total: c.length
                                                }),
                                                w && p.trigger({
                                                type: "uploadprogress",
                                                loaded: w.size || 1025,
                                                total: w.size || 1025
                                            }))
                                    } catch (r) {
                                        if (!i.hasSameOrigin(d.url))
                                            return void e.call(p, function() {
                                                p.trigger("error")
                                            });
                                        u = 404
                                    }
                                    e.call(p, function() {
                                        p.trigger("load")
                                    })
                                }, p.uid)
                        }
                        var p = this, m = p.getRuntime(), g, v, y, w;
                        if (u = c = null,
                            f instanceof s && f.hasBlob()) {
                            if (w = f.getBlob(),
                                g = w.uid,
                                y = n.get(g),
                                v = n.get(g + "_form"),
                                !v)
                                throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)
                        } else
                            g = t.guid("uid_"),
                                v = document.createElement("form"),
                                v.setAttribute("id", g + "_form"),
                                v.setAttribute("method", d.method),
                                v.setAttribute("enctype", "multipart/form-data"),
                                v.setAttribute("encoding", "multipart/form-data"),
                                v.setAttribute("target", g + "_iframe"),
                                m.getShimContainer().appendChild(v);
                        f instanceof s && f.each(function(e, n) {
                            if (e instanceof a)
                                y && y.setAttribute("name", n);
                            else {
                                var i = document.createElement("input");
                                t.extend(i, {
                                    type: "hidden",
                                    name: n,
                                    value: e
                                }),
                                    y ? v.insertBefore(i, y) : v.appendChild(i)
                            }
                        }),
                            v.setAttribute("action", d.url),
                            h(),
                            v.submit(),
                            p.trigger("loadstart")
                    },
                    getStatus: function() {
                        return u
                    },
                    getResponse: function(e) {
                        if ("json" === e && "string" === t.typeOf(c) && window.JSON)
                            try {
                                return JSON.parse(c.replace(/^\s*<pre[^>]*>/, "").replace(/<\/pre>\s*$/, ""))
                            } catch (n) {
                                return null
                            }
                        return c
                    },
                    abort: function() {
                        var t = this;
                        l && l.contentWindow && (l.contentWindow.stop ? l.contentWindow.stop() : l.contentWindow.document.execCommand ? l.contentWindow.document.execCommand("Stop") : l.src = "about:blank"),
                            e.call(this, function() {
                                t.dispatchEvent("abort")
                            })
                    }
                })
            }
            return e.XMLHttpRequest = u
        }),
        i(ft, [ut, X], function(e, t) {
            return e.Image = t
        }),
        a([u, c, l, d, f, h, p, m, g, v, y, w, E, _, x, b, R, T, A, S, O, I, L])
}(this);
;(function(e) {
    "use strict";
    var t = {}
        , n = e.moxie.core.utils.Basic.inArray;
    return function r(e) {
        var i, s;
        for (i in e)
            s = typeof e[i],
                    s === "object" && !~n(i, ["Exceptions", "Env", "Mime"]) ? r(e[i]) : s === "function" && (t[i] = e[i])
    }(e.moxie),
        t.Env = e.moxie.core.utils.Env,
        t.Mime = e.moxie.core.utils.Mime,
        t.Exceptions = e.moxie.core.Exceptions,
        e.mOxie = t,
        e.o || (e.o = t),
        t
})(this);
;(function(e, t, n) {
    function s(e) {
        function r(e, t, r) {
            var i = {
                chunks: "slice_blob",
                jpgresize: "send_binary_string",
                pngresize: "send_binary_string",
                progress: "report_upload_progress",
                multi_selection: "select_multiple",
                dragdrop: "drag_and_drop",
                drop_element: "drag_and_drop",
                headers: "send_custom_headers",
                urlstream_upload: "send_binary_string",
                canSendBinary: "send_binary",
                triggerDialog: "summon_file_dialog"
            };
            i[e] ? n[i[e]] = t : r || (n[e] = t)
        }
        var t = e.required_features
            , n = {};
        if (typeof t == "string")
            o.each(t.split(/\s*,\s*/), function(e) {
                r(e, !0)
            });
        else if (typeof t == "object")
            o.each(t, function(e, t) {
                r(t, e)
            });
        else if (t === !0) {
            e.chunk_size > 0 && (n.slice_blob = !0);
            if (e.resize.enabled || !e.multipart)
                n.send_binary_string = !0;
            o.each(e, function(e, t) {
                r(t, !!e, !0)
            })
        }
        return n
    }
    var r = e.setTimeout
        , i = {}
        , o = {
            VERSION: "2.1.2",
            STOPPED: 1,
            STARTED: 2,
            QUEUED: 1,
            UPLOADING: 2,
            FAILED: 4,
            DONE: 5,
            GENERIC_ERROR: -100,
            HTTP_ERROR: -200,
            IO_ERROR: -300,
            SECURITY_ERROR: -400,
            INIT_ERROR: -500,
            FILE_SIZE_ERROR: -600,
            FILE_EXTENSION_ERROR: -601,
            FILE_DUPLICATE_ERROR: -602,
            IMAGE_FORMAT_ERROR: -700,
            MEMORY_ERROR: -701,
            IMAGE_DIMENSIONS_ERROR: -702,
            mimeTypes: t.mimes,
            ua: t.ua,
            typeOf: t.typeOf,
            extend: t.extend,
            guid: t.guid,
            get: function(n) {
                var r = [], i;
                t.typeOf(n) !== "array" && (n = [n]);
                var s = n.length;
                while (s--)
                    i = t.get(n[s]),
                        i && r.push(i);
                return r.length ? r : null
            },
            each: t.each,
            getPos: t.getPos,
            getSize: t.getSize,
            xmlEncode: function(e) {
                var t = {
                        "<": "lt",
                        ">": "gt",
                        "&": "amp",
                        '"': "quot",
                        "'": "#39"
                    }
                    , n = /[<>&\"\']/g;
                return e ? ("" + e).replace(n, function(e) {
                    return t[e] ? "&" + t[e] + ";" : e
                }) : e
            },
            toArray: t.toArray,
            inArray: t.inArray,
            addI18n: t.addI18n,
            translate: t.translate,
            isEmptyObj: t.isEmptyObj,
            hasClass: t.hasClass,
            addClass: t.addClass,
            removeClass: t.removeClass,
            getStyle: t.getStyle,
            addEvent: t.addEvent,
            removeEvent: t.removeEvent,
            removeAllEvents: t.removeAllEvents,
            cleanName: function(e) {
                var t, n;
                n = [/[\300-\306]/g, "A", /[\340-\346]/g, "a", /\307/g, "C", /\347/g, "c", /[\310-\313]/g, "E", /[\350-\353]/g, "e", /[\314-\317]/g, "I", /[\354-\357]/g, "i", /\321/g, "N", /\361/g, "n", /[\322-\330]/g, "O", /[\362-\370]/g, "o", /[\331-\334]/g, "U", /[\371-\374]/g, "u"];
                for (t = 0; t < n.length; t += 2)
                    e = e.replace(n[t], n[t + 1]);
                return e = e.replace(/\s+/g, "_"),
                    e = e.replace(/[^a-z0-9_\-\.]+/gi, ""),
                    e
            },
            buildUrl: function(e, t) {
                var n = "";
                return o.each(t, function(e, t) {
                    n += (n ? "&" : "") + encodeURIComponent(t) + "=" + encodeURIComponent(e)
                }),
                    n && (e += (e.indexOf("?") > 0 ? "&" : "?") + n),
                    e
            },
            formatSize: function(e) {
                function t(e, t) {
                    return Math.round(e * Math.pow(10, t)) / Math.pow(10, t)
                }
                if (e === n || /\D/.test(e))
                    return o.translate("N/A");
                var r = Math.pow(1024, 4);
                return e > r ? t(e / r, 1) + " " + o.translate("tb") : e > (r /= 1024) ? t(e / r, 1) + " " + o.translate("gb") : e > (r /= 1024) ? t(e / r, 1) + " " + o.translate("mb") : e > 1024 ? Math.round(e / 1024) + " " + o.translate("kb") : e + " " + o.translate("b")
            },
            parseSize: t.parseSizeStr,
            predictRuntime: function(e, n) {
                var r, i;
                return r = new o.Uploader(e),
                    i = t.Runtime.thatCan(r.getOption().required_features, n || e.runtimes),
                    r.destroy(),
                    i
            },
            addFileFilter: function(e, t) {
                i[e] = t
            }
        };
    o.addFileFilter("mime_types", function(e, t, n) {
        e.length && !e.regexp.test(t.name) ? (this.trigger("Error", {
            code: o.FILE_EXTENSION_ERROR,
            message: o.translate("File extension error."),
            file: t
        }),
            n(!1)) : n(!0)
    }),
        o.addFileFilter("max_file_size", function(e, t, n) {
            var r;
            e = o.parseSize(e),
                    t.size !== r && e && t.size > e ? (this.trigger("Error", {
                code: o.FILE_SIZE_ERROR,
                message: o.translate("File size error."),
                file: t
            }),
                n(!1)) : n(!0)
        }),
        o.addFileFilter("prevent_duplicates", function(e, t, n) {
            if (e) {
                var r = this.files.length;
                while (r--)
                    if (t.name === this.files[r].name && t.size === this.files[r].size) {
                        this.trigger("Error", {
                            code: o.FILE_DUPLICATE_ERROR,
                            message: o.translate("Duplicate file error."),
                            file: t
                        }),
                            n(!1);
                        return
                    }
            }
            n(!0)
        }),
        o.Uploader = function(e) {
            function g() {
                var e, t = 0, n;
                if (this.state == o.STARTED) {
                    for (n = 0; n < f.length; n++)
                        !e && f[n].status == o.QUEUED ? (e = f[n],
                            this.trigger("BeforeUpload", e) && (e.status = o.UPLOADING,
                            this.trigger("UploadFile", e))) : t++;
                    t == f.length && (this.state !== o.STOPPED && (this.state = o.STOPPED,
                        this.trigger("StateChanged")),
                        this.trigger("UploadComplete", f))
                }
            }
            function y(e) {
                e.percent = e.size > 0 ? Math.ceil(e.loaded / e.size * 100) : 100,
                    b()
            }
            function b() {
                var e, t;
                d.reset();
                for (e = 0; e < f.length; e++)
                    t = f[e],
                            t.size !== n ? (d.size += t.origSize,
                        d.loaded += t.loaded * t.origSize / t.size) : d.size = n,
                            t.status == o.DONE ? d.uploaded++ : t.status == o.FAILED ? d.failed++ : d.queued++;
                d.size === n ? d.percent = f.length > 0 ? Math.ceil(d.uploaded / f.length * 100) : 0 : (d.bytesPerSec = Math.ceil(d.loaded / ((+(new Date) - p || 1) / 1e3)),
                    d.percent = d.size > 0 ? Math.ceil(d.loaded / d.size * 100) : 0)
            }
            function w() {
                var e = c[0] || h[0];
                return e ? e.getRuntime().uid : !1
            }
            function E(e, n) {
                if (e.ruid) {
                    var r = t.Runtime.getInfo(e.ruid);
                    if (r)
                        return r.can(n)
                }
                return !1
            }
            function S() {
                this.bind("FilesAdded FilesRemoved", function(e) {
                    e.trigger("QueueChanged"),
                        e.refresh()
                }),
                    this.bind("CancelUpload", O),
                    this.bind("BeforeUpload", C),
                    this.bind("UploadFile", k),
                    this.bind("UploadProgress", L),
                    this.bind("StateChanged", A),
                    this.bind("QueueChanged", b),
                    this.bind("Error", _),
                    this.bind("FileUploaded", M),
                    this.bind("Destroy", D)
            }
            function x(e, n) {
                var r = this
                    , i = 0
                    , s = []
                    , u = {
                        runtime_order: e.runtimes,
                        required_caps: e.required_features,
                        preferred_caps: l,
                        swf_url: e.flash_swf_url,
                        xap_url: e.silverlight_xap_url
                    };
                o.each(e.runtimes.split(/\s*,\s*/), function(t) {
                    e[t] && (u[t] = e[t])
                }),
                    e.browse_button && o.each(e.browse_button, function(n) {
                    s.push(function(s) {
                        var a = new t.FileInput(o.extend({}, u, {
                            accept: e.filters.mime_types,
                            name: e.file_data_name,
                            multiple: e.multi_selection,
                            container: e.container,
                            browse_button: n
                        }));
                        a.onready = function() {
                            var e = t.Runtime.getInfo(this.ruid);
                            t.extend(r.features, {
                                chunks: e.can("slice_blob"),
                                multipart: e.can("send_multipart"),
                                multi_selection: e.can("select_multiple")
                            }),
                                i++,
                                c.push(this),
                                s()
                        }
                            ,
                            a.onchange = function() {
                                r.addFile(this.files)
                            }
                            ,
                            a.bind("mouseenter mouseleave mousedown mouseup", function(r) {
                                v || (e.browse_button_hover && ("mouseenter" === r.type ? t.addClass(n, e.browse_button_hover) : "mouseleave" === r.type && t.removeClass(n, e.browse_button_hover)),
                                    e.browse_button_active && ("mousedown" === r.type ? t.addClass(n, e.browse_button_active) : "mouseup" === r.type && t.removeClass(n, e.browse_button_active)))
                            }),
                            a.bind("mousedown", function() {
                                r.trigger("Browse")
                            }),
                            a.bind("error runtimeerror", function() {
                                a = null,
                                    s()
                            }),
                            a.init()
                    })
                }),
                    e.drop_element && o.each(e.drop_element, function(e) {
                    s.push(function(n) {
                        var s = new t.FileDrop(o.extend({}, u, {
                            drop_zone: e
                        }));
                        s.onready = function() {
                            var e = t.Runtime.getInfo(this.ruid);
                            r.features.dragdrop = e.can("drag_and_drop"),
                                i++,
                                h.push(this),
                                n()
                        }
                            ,
                            s.ondrop = function() {
                                r.addFile(this.files)
                            }
                            ,
                            s.bind("error runtimeerror", function() {
                                s = null,
                                    n()
                            }),
                            s.init()
                    })
                }),
                    t.inSeries(s, function() {
                        typeof n == "function" && n(i)
                    })
            }
            function T(e, r, i) {
                var s = new t.Image;
                try {
                    s.onload = function() {
                        if (r.width > this.width && r.height > this.height && r.quality === n && r.preserve_headers && !r.crop)
                            return this.destroy(),
                                i(e);
                        s.downsize(r.width, r.height, r.crop, r.preserve_headers)
                    }
                        ,
                        s.onresize = function() {
                            i(this.getAsBlob(e.type, r.quality)),
                                this.destroy()
                        }
                        ,
                        s.onerror = function() {
                            i(e)
                        }
                        ,
                        s.load(e)
                } catch (o) {
                    i(e)
                }
            }
            function N(e, n, r) {
                function f(e, t, n) {
                    var r = a[e];
                    switch (e) {
                        case "max_file_size":
                            e === "max_file_size" && (a.max_file_size = a.filters.max_file_size = t);
                            break;
                        case "chunk_size":
                            if (t = o.parseSize(t))
                                a[e] = t,
                                    a.send_file_name = !0;
                            break;
                        case "multipart":
                            a[e] = t,
                                t || (a.send_file_name = !0);
                            break;
                        case "unique_names":
                            a[e] = t,
                                t && (a.send_file_name = !0);
                            break;
                        case "filters":
                            o.typeOf(t) === "array" && (t = {
                                mime_types: t
                            }),
                                n ? o.extend(a.filters, t) : a.filters = t,
                                t.mime_types && (a.filters.mime_types.regexp = function(e) {
                                var t = [];
                                return o.each(e, function(e) {
                                    o.each(e.extensions.split(/,/), function(e) {
                                        /^\s*\*\s*$/.test(e) ? t.push("\\.*") : t.push("\\." + e.replace(new RegExp("[" + "/^$.*+?|()[]{}\\".replace(/./g, "\\$&") + "]","g"), "\\$&"))
                                    })
                                }),
                                    new RegExp("(" + t.join("|") + ")$","i")
                            }(a.filters.mime_types));
                            break;
                        case "resize":
                            n ? o.extend(a.resize, t, {
                                enabled: !0
                            }) : a.resize = t;
                            break;
                        case "prevent_duplicates":
                            a.prevent_duplicates = a.filters.prevent_duplicates = !!t;
                            break;
                        case "browse_button":
                        case "drop_element":
                            t = o.get(t);
                        case "container":
                        case "runtimes":
                        case "multi_selection":
                        case "flash_swf_url":
                        case "silverlight_xap_url":
                            a[e] = t,
                                n || (u = !0);
                            break;
                        default:
                            a[e] = t
                    }
                    n || i.trigger("OptionChanged", e, t, r)
                }
                var i = this
                    , u = !1;
                typeof e == "object" ? o.each(e, function(e, t) {
                    f(t, e, r)
                }) : f(e, n, r),
                    r ? (a.required_features = s(o.extend({}, a)),
                        l = s(o.extend({}, a, {
                            required_features: !0
                        }))) : u && (i.trigger("Destroy"),
                        x.call(i, a, function(e) {
                            e ? (i.runtime = t.Runtime.getInfo(w()).type,
                                i.trigger("Init", {
                                    runtime: i.runtime
                                }),
                                i.trigger("PostInit")) : i.trigger("Error", {
                                code: o.INIT_ERROR,
                                message: o.translate("Init error.")
                            })
                        }))
            }
            function C(e, t) {
                if (e.settings.unique_names) {
                    var n = t.name.match(/\.([^.]+)$/)
                        , r = "part";
                    n && (r = n[1]),
                        t.target_name = t.id + "." + r
                }
            }
            function k(e, n) {
                function h() {
                    u-- > 0 ? r(p, 1e3) : (n.loaded = f,
                        e.trigger("Error", {
                            code: o.HTTP_ERROR,
                            message: o.translate("HTTP Error."),
                            file: n,
                            response: m.responseText,
                            status: m.status,
                            responseHeaders: m.getAllResponseHeaders()
                        }))
                }
                function p() {
                    var d, v, g = {}, y;
                    if (n.status !== o.UPLOADING || e.state === o.STOPPED)
                        return;
                    e.settings.send_file_name && (g.name = n.target_name || n.name),
                            s && a.chunks && c.size > s ? (y = Math.min(s, c.size - f),
                        d = c.slice(f, f + y)) : (y = c.size,
                        d = c),
                        s && a.chunks && (e.settings.send_chunk_number ? (g.chunk = Math.ceil(f / s),
                        g.chunks = Math.ceil(c.size / s)) : (g.offset = f,
                        g.total = c.size)),
                        m = new t.XMLHttpRequest,
                        m.upload && (m.upload.onprogress = function(t) {
                        n.loaded = Math.min(n.size, f + t.loaded),
                            e.trigger("UploadProgress", n)
                    }
                        ),
                        m.onload = function() {
                            if (m.status >= 400) {
                                h();
                                return
                            }
                            u = e.settings.max_retries,
                                    y < c.size ? (d.destroy(),
                                f += y,
                                n.loaded = Math.min(f, c.size),
                                e.trigger("ChunkUploaded", n, {
                                    offset: n.loaded,
                                    total: c.size,
                                    response: m.responseText,
                                    status: m.status,
                                    responseHeaders: m.getAllResponseHeaders()
                                }),
                                t.Env.browser === "Android Browser" && e.trigger("UploadProgress", n)) : n.loaded = n.size,
                                d = v = null,
                                    !f || f >= c.size ? (n.size != n.origSize && (c.destroy(),
                                c = null),
                                e.trigger("UploadProgress", n),
                                n.status = o.DONE,
                                e.trigger("FileUploaded", n, {
                                    response: m.responseText,
                                    status: m.status,
                                    responseHeaders: m.getAllResponseHeaders()
                                })) : r(p, 1)
                        }
                        ,
                        m.onerror = function() {
                            h()
                        }
                        ,
                        m.onloadend = function() {
                            this.destroy(),
                                m = null
                        }
                        ,
                            e.settings.multipart && a.multipart ? (m.open("post", i, !0),
                        o.each(e.settings.headers, function(e, t) {
                            m.setRequestHeader(t, e)
                        }),
                        v = new t.FormData,
                        o.each(o.extend(g, e.settings.multipart_params), function(e, t) {
                            v.append(t, e)
                        }),
                        v.append(e.settings.file_data_name, d),
                        m.send(v, {
                            runtime_order: e.settings.runtimes,
                            required_caps: e.settings.required_features,
                            preferred_caps: l,
                            swf_url: e.settings.flash_swf_url,
                            xap_url: e.settings.silverlight_xap_url
                        })) : (i = o.buildUrl(e.settings.url, o.extend(g, e.settings.multipart_params)),
                        m.open("post", i, !0),
                        m.setRequestHeader("Content-Type", "application/octet-stream"),
                        o.each(e.settings.headers, function(e, t) {
                            m.setRequestHeader(t, e)
                        }),
                        m.send(d, {
                            runtime_order: e.settings.runtimes,
                            required_caps: e.settings.required_features,
                            preferred_caps: l,
                            swf_url: e.settings.flash_swf_url,
                            xap_url: e.settings.silverlight_xap_url
                        }))
                }
                var i = e.settings.url, s = e.settings.chunk_size, u = e.settings.max_retries, a = e.features, f = 0, c;
                n.loaded && (f = n.loaded = s ? s * Math.floor(n.loaded / s) : 0),
                    c = n.getSource(),
                        e.settings.resize.enabled && E(c, "send_binary_string") && !!~t.inArray(c.type, ["image/jpeg", "image/png"]) ? T.call(this, c, e.settings.resize, function(e) {
                    c = e,
                        n.size = e.size,
                        p()
                }) : p()
            }
            function L(e, t) {
                y(t)
            }
            function A(e) {
                if (e.state == o.STARTED)
                    p = +(new Date);
                else if (e.state == o.STOPPED)
                    for (var t = e.files.length - 1; t >= 0; t--)
                        e.files[t].status == o.UPLOADING && (e.files[t].status = o.QUEUED,
                            b())
            }
            function O() {
                m && m.abort()
            }
            function M(e) {
                b(),
                    r(function() {
                        g.call(e)
                    }, 1)
            }
            function _(e, t) {
                t.code === o.INIT_ERROR ? e.destroy() : t.file && (t.file.status = o.FAILED,
                    y(t.file),
                    e.state == o.STARTED && (e.trigger("CancelUpload"),
                    r(function() {
                        g.call(e)
                    }, 1)))
            }
            function D(e) {
                e.stop(),
                    o.each(f, function(e) {
                        e.destroy()
                    }),
                    f = [],
                    c.length && (o.each(c, function(e) {
                    e.destroy()
                }),
                    c = []),
                    h.length && (o.each(h, function(e) {
                    e.destroy()
                }),
                    h = []),
                    l = {},
                    v = !1,
                    p = m = null,
                    d.reset()
            }
            var u = o.guid(), a, f = [], l = {}, c = [], h = [], p, d, v = !1, m;
            a = {
                runtimes: t.Runtime.order,
                max_retries: 0,
                chunk_size: 0,
                multipart: !0,
                multi_selection: !0,
                file_data_name: "file",
                flash_swf_url: "js/Moxie.swf",
                silverlight_xap_url: "js/Moxie.xap",
                filters: {
                    mime_types: [],
                    prevent_duplicates: !1,
                    max_file_size: 0
                },
                resize: {
                    enabled: !1,
                    preserve_headers: !0,
                    crop: !1
                },
                send_file_name: !0,
                send_chunk_number: !0
            },
                N.call(this, e, null, !0),
                d = new o.QueueProgress,
                o.extend(this, {
                    id: u,
                    uid: u,
                    state: o.STOPPED,
                    features: {},
                    runtime: null,
                    files: f,
                    settings: a,
                    total: d,
                    init: function() {
                        var e = this;
                        typeof a.preinit == "function" ? a.preinit(e) : o.each(a.preinit, function(t, n) {
                            e.bind(n, t)
                        }),
                            S.call(this);
                        if (!a.browse_button || !a.url) {
                            this.trigger("Error", {
                                code: o.INIT_ERROR,
                                message: o.translate("Init error.")
                            });
                            return
                        }
                        x.call(this, a, function(n) {
                            typeof a.init == "function" ? a.init(e) : o.each(a.init, function(t, n) {
                                e.bind(n, t)
                            }),
                                n ? (e.runtime = t.Runtime.getInfo(w()).type,
                                    e.trigger("Init", {
                                        runtime: e.runtime
                                    }),
                                    e.trigger("PostInit")) : e.trigger("Error", {
                                    code: o.INIT_ERROR,
                                    message: o.translate("Init error.")
                                })
                        })
                    },
                    setOption: function(e, t) {
                        N.call(this, e, t, !this.runtime)
                    },
                    getOption: function(e) {
                        return e ? a[e] : a
                    },
                    refresh: function() {
                        c.length && o.each(c, function(e) {
                            e.trigger("Refresh")
                        }),
                            this.trigger("Refresh")
                    },
                    start: function() {
                        this.state != o.STARTED && (this.state = o.STARTED,
                            this.trigger("StateChanged"),
                            g.call(this))
                    },
                    stop: function() {
                        this.state != o.STOPPED && (this.state = o.STOPPED,
                            this.trigger("StateChanged"),
                            this.trigger("CancelUpload"))
                    },
                    disableBrowse: function() {
                        v = arguments[0] !== n ? arguments[0] : !0,
                            c.length && o.each(c, function(e) {
                            e.disable(v)
                        }),
                            this.trigger("DisableBrowse", v)
                    },
                    getFile: function(e) {
                        var t;
                        for (t = f.length - 1; t >= 0; t--)
                            if (f[t].id === e)
                                return f[t]
                    },
                    addFile: function(e, n) {
                        function c(e, n) {
                            var r = [];
                            t.each(s.settings.filters, function(t, n) {
                                i[n] && r.push(function(r) {
                                    i[n].call(s, t, e, function(e) {
                                        r(!e)
                                    })
                                })
                            }),
                                t.inSeries(r, n)
                        }
                        function h(e) {
                            var i = t.typeOf(e);
                            if (e instanceof t.File) {
                                if (!e.ruid && !e.isDetached()) {
                                    if (!l)
                                        return !1;
                                    e.ruid = l,
                                        e.connectRuntime(l)
                                }
                                h(new o.File(e))
                            } else
                                e instanceof t.Blob ? (h(e.getSource()),
                                    e.destroy()) : e instanceof o.File ? (n && (e.name = n),
                                    u.push(function(t) {
                                        c(e, function(n) {
                                            n || (f.push(e),
                                                a.push(e),
                                                s.trigger("FileFiltered", e)),
                                                r(t, 1)
                                        })
                                    })) : t.inArray(i, ["file", "blob"]) !== -1 ? h(new t.File(null,e)) : i === "node" && t.typeOf(e.files) === "filelist" ? t.each(e.files, h) : i === "array" && (n = null,
                                    t.each(e, h))
                        }
                        var s = this, u = [], a = [], l;
                        l = w(),
                            h(e),
                            u.length && t.inSeries(u, function() {
                            a.length && s.trigger("FilesAdded", a)
                        })
                    },
                    removeFile: function(e) {
                        var t = typeof e == "string" ? e : e.id;
                        for (var n = f.length - 1; n >= 0; n--)
                            if (f[n].id === t)
                                return this.splice(n, 1)[0]
                    },
                    splice: function(e, t) {
                        var r = f.splice(e === n ? 0 : e, t === n ? f.length : t)
                            , i = !1;
                        return this.state == o.STARTED && (o.each(r, function(e) {
                            if (e.status === o.UPLOADING)
                                return i = !0,
                                    !1
                        }),
                            i && this.stop()),
                            this.trigger("FilesRemoved", r),
                            o.each(r, function(e) {
                                e.destroy()
                            }),
                            i && this.start(),
                            r
                    },
                    bind: function(e, t, n) {
                        var r = this;
                        o.Uploader.prototype.bind.call(this, e, function() {
                            var e = [].slice.call(arguments);
                            return e.splice(0, 1, r),
                                t.apply(this, e)
                        }, 0, n)
                    },
                    destroy: function() {
                        this.trigger("Destroy"),
                            a = d = null,
                            this.unbindAll()
                    }
                })
        }
        ,
        o.Uploader.prototype = t.EventTarget.instance,
        o.File = function() {
            function n(n) {
                o.extend(this, {
                    id: o.guid(),
                    name: n.name || n.fileName,
                    type: n.type || "",
                    size: n.size || n.fileSize,
                    origSize: n.size || n.fileSize,
                    loaded: 0,
                    percent: 0,
                    status: o.QUEUED,
                    lastModifiedDate: n.lastModifiedDate || (new Date).toLocaleString(),
                    getNative: function() {
                        var e = this.getSource().getSource();
                        return t.inArray(t.typeOf(e), ["blob", "file"]) !== -1 ? e : null
                    },
                    getSource: function() {
                        return e[this.id] ? e[this.id] : null
                    },
                    destroy: function() {
                        var t = this.getSource();
                        t && (t.destroy(),
                            delete e[this.id])
                    }
                }),
                    e[this.id] = n
            }
            var e = {};
            return n
        }(),
        o.QueueProgress = function() {
            var e = this;
            e.size = 0,
                e.loaded = 0,
                e.uploaded = 0,
                e.failed = 0,
                e.queued = 0,
                e.percent = 0,
                e.bytesPerSec = 0,
                e.reset = function() {
                    e.size = e.loaded = e.uploaded = e.failed = e.queued = e.percent = e.bytesPerSec = 0
                }
        }
        ,
        e.plupload = o
})(window, mOxie);
;(function($) {
    window.anchor = {
        settings: {
            transitionDuration: 2000,
            transitionTimingFunction: 'swing',
            labels: {
                error: 'Couldn\'t find any section'
            }
        },
        init: function(options) {
            $(this).data('settings', $.extend(anchor.settings, options));
            return this.each(function() {
                var $this = $(this);
                $this.unbind('click').click(function(event) {
                    event.preventDefault();
                    anchor.jumpTo(anchor.getTopOffsetPosition($this), $this.data('settings'));
                });
            });
        },
        getTopOffsetPosition: function($object) {
            var href = $object.attr('href')
                , $section = $($(href).get(0))
                , documentHeight = $(document).height()
                , browserHeight = $(window).height();
            if (!$section || $section.length < 1) {
                throw new ReferenceError(anchor.settings.labels.error);
            }
            if (($section.offset().top + browserHeight) > documentHeight) {
                return documentHeight - browserHeight;
            } else {
                return $section.offset().top;
            }
        },
        jumpTo: function(topOffsetPosition, settings) {
            var $viewport = $('html, body');
            $viewport.animate({
                scrollTop: topOffsetPosition
            }, settings.transitionDuration, settings.transitionTimingFunction);
            $viewport.bind('scroll mousedown DOMMouseScroll mousewheel keyup', function(event) {
                if (event.which > 0 || event.type === 'mousedown' || event.type === 'mousewheel') {
                    $viewport.stop().unbind('scroll mousedown DOMMouseScroll mousewheel keyup');
                }
            });
        }
    };
    $.fn.anchor = function(method) {
        if (anchor[method]) {
            return anchor[method].apply(this, Array.prototype.slice.call(arguments, 1));
        } else if (typeof method === 'object' || !method) {
            return anchor.init.apply(this, arguments);
        } else {
            return $.error('Method ' + method + ' does not exist on jQuery.anchor');
        }
    }
    ;
})(jQuery);
$('.media-form .checkbox').checkbox().checkbox({
    onChange: function() {
        var checked_id = $(this).val();
        $(this).parent().siblings('.weibo_field[data-weibo="' + checked_id + '"]').transition('scale');
    }
});
$('.auto-fill').hide();
$('.unsaved').on('click', '.auto-fill', function() {
    $(this).find('.auto-fill-done').addClass('active');
    setTimeout(function() {
        $('.auto-fill-done.active').removeClass('active')
    }, 1500);
});
tmp_tags = [];
$('.uploading-file').data('vid', '').data('key', '');
$('.error-msg').on('click', '.refresh', function() {
    $(this).parent().siblings('input').val('xxx');
    $(this).parent().remove();
});
$('#modal-video-process').on('click', function() {
    $('#video-process').modal('show');
});
$('.modal .close-btn').click(function() {
    $(this).parents('.modal').modal('hide');
});
$('#modal-forbidden').on('click', function() {
    $('#forbidden').modal('show');
});
//渠道的点击  all-accounts  .media-info.clickable
$('.row.media-wrapper.all-accounts').on('click','.media-info.clickable',function() {
    var selected_form = $('#form_' + $(this).data('mid'));
    console.log(".media-info.clickable  click "+"selected_form="+selected_form);
    if (!$(this).hasClass('active')) {
        $(this).addClass('active');
        selected_form.fadeIn();
        selected_form.addClass('active');
    } else {
        $(this).removeClass('active');
        selected_form.fadeOut();
        selected_form.removeClass('active');
    }
    var selected_num = $('.media-info.clickable.active').length;

    $('#select-account').removeClass('blink');

    if (selected_num == 0) {
        $('.empty-media-tip').fadeIn();
        if (!$('.uploading-file').data('vid')) {
            $('.save-all').hide();
        }
    } else {
        $('.empty-media-tip').hide();
        $('.save-all').fadeIn();
    }
    $('#num-chosen').text(selected_num + ' / ' + selected_num);
});
$('.field.timing').calendar({
    type: 'datetime',
    text: {
        days: ["日", "一", "二", "三", "四", "五", "六"],
        months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
        monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
        today: "今天",
        now: "现在",
        am: "AM",
        pm: "PM"
    },
    formatter: {
        date: function(date, settings) {
            if (!date)
                return '';
            var day = date.getDate();
            var month = date.getMonth() + 1;
            var year = date.getFullYear();
            month = (month < 10 ? '0' : '') + month;
            day = (day < 10 ? '0' : '') + day;
            return year + '-' + month + '-' + day;
        },
        time: function(time, settings) {
            var minute = time.getMinutes();
            var hour = time.getHours();
            minute = (minute < 10 ? '0' : '') + minute;
            return hour + ':' + minute;
        }
    },
    minDate: new Date("2017/03/03 15:59"),
    maxDate: new Date("2017/03/10 15:59")
});
$('.delete-cover').on('click', function() {
    $(this).siblings('.cover-btn').html('<i class="iconfont icon-jiahao"></i>上传封面');
    $(this).siblings('input[name="cover"]').val('');
    $(this).siblings('.file-tip').show();
    $(this).siblings('.current-file').text('');
    $('input[name="fake"]').val('');
    $(this).hide();
});
$('.cover-btn').on('click', function() {
    $(this).siblings('input[type=file]').trigger('click');
});
$('input[name="fake"]').on('change', function() {
    var btn = $(this).siblings('.cover-btn');
    var pl_file = this.files[0];
    var uploader = new plupload.Uploader({
        runtimes: 'html5,flash,silverlight,html4',
        url: "/up/upload/cover/",
        filters: {
            mime_types: [{
                title: "Image files",
                extensions: "jpg,jpeg,png"
            }],
            max_file_size: "2mb"
        },
        browse_button: 'hi',
        headers: {
            'X-Requested-With': 'XMLHttpRequest',
            'X-CSRFToken': 'LweVmIRi58E3glqNDhSkvr8rPTLVOcRR'
        },
        init: {
            PostInit: function() {
                uploader.addFile(pl_file);
                uploader.start();
            },
            UploadProgress: function(up, file) {
                btn.text('已上传' + file.percent + '%');
                if (file.percent == 100) {
                    btn.text('正在预处理图片');
                }
            },
            UploadComplete: function(up, files) {},
            FileUploaded: function(up, file, info) {
                console.log(btn.siblings('input[name="cover"]'));
                console.log(file);
                console.log(info);
                btn.siblings('input[type="text"].hidden').val(info.response);
                btn.text('上传成功');
            },
            FilesAdded: function(up, files) {
                btn.siblings('span.current-file').text(files[0].name);
                tmp_cover_name = files[0].name
                btn.siblings('.file-tip').hide();
                btn.siblings('.delete-cover').show()
            },
            Error: function(up, err) {
                btn.text("出现错误! 请重试");
                if (err.code == -601) {
                    btn.text("上传格式错误，支持JPG或PNG格式");
                }
                if (err.code == -600) {
                    btn.text("文件过大，请上传小于3mb的图片");
                }
                document.getElementById('console').appendChild(document.createTextNode("\nError #" + err.code + ": " + err.message));
            }
        }
    });
    uploader.init();
});
$('input.counting, textarea.counting').on('input propertychange', function() {
    function getBt(str) {
        var char = str.replace(/[^\x00-\xff]/g, '**');
        return char.length;
    }
    var cur_len = parseInt((getBt($(this).val()) + 1) / 2);
    var max_len = $(this).data('maxlength');
    $(this).siblings('.counter').text(cur_len + ' / ' + max_len);
});
$('.saved .bottom-btn').on('click', function() {
    $(this).parents('.media-form').find('.triangle-bottom-right').removeClass('active');
    $(this).parents('.media-form').find('.saved-label').removeClass('active');
    $(this).parents('.saved').hide().siblings('.unsaved').api('remove loading').fadeIn();
    $(this).parents('.saved').hide().siblings('.unsaved').removeClass('success');
});
tmp_title = '';
tmp_cover = '';
tmp_cover_name = '';
tmp_tags = [];
tmp_timing = '';
tmp_description = '';
$('.filling-area').on('click', '.auto-fill', function() {
    ele = $(this).parents('.media-form');
    ele.form('get field', 'name').val(tmp_title);
    ele.form('get field', 'description').val(tmp_description);
    ele.form('get field', 'timing').val(tmp_timing);
    if (tmp_cover) {
        ele.form('get field', 'cover').val(tmp_cover);
        ele.find('.cover-btn').html('上传成功');
        ele.find('.current-file').text(tmp_cover_name);
        ele.find('.delete-cover').show()
    }
    if (tmp_tags) {
        ele.find('.addition.search.tag-dropdown').dropdown('set selected', tmp_tags)
    }
});
var virtual_form = function(btn) {
    var ele = $(btn).parents('.media-form');
    var title = ele.form('get field', 'name').val();
    if (title) {
        tmp_title = title
    }
    var tags = $(ele).form('get field', 'tags').val();
    if (tags) {
        tmp_tags = tags
    }
    var description = $(ele).form('get field', 'description').val();
    if (description) {
        tmp_description = description
    }
    var timing = $(ele).form('get field', 'timing').val();
    if (timing) {
        tmp_timing = timing
    }
    var cover = $(ele).form('get field', 'cover').val();
    if (cover) {
        tmp_cover = cover;
    }
    $('.auto-fill').show();
    $(ele).parents('.media-form').find('.auto-fill').hide()
};
$.fn.form.settings.templates.prompt = function(errors) {
    return $('<div/>').addClass('error-msg').html(errors[0]);
}
;
$.fn.dropdown.settings.templates.label = function(value, text) {
    return text + '<i class="iconfont icon-iconfontcha"></i>';
}
;
$.fn.form.settings.rules.maxByte = function(value, maxByte) {
    var char = value.replace(/[^\x00-\xff]/g, '**');
    return char.length <= maxByte;
}
;
$.fn.form.settings.rules.fileExt = function(value) {
    var ext = value.substring(value.lastIndexOf(".") + 1);
    return ext == "jpg" || ext == "jpeg"
}
;
$.fn.form.settings.rules.fileSize = function(value, Size) {
    var form = this['context'];
    var input = this[0];
    if (input.files[0]) {
        return input.files[0].size <= 1024 * 1024 * Size
    }
    return true
}
;
$.fn.form.settings.rules.youkuTagLength = function(value) {
    var _e = false;
    $.each(value.split(","), function(i, e) {
        if (e.replace(/[^\x00-\xff]/g, '**').length < 2 || e.replace(/[^\x00-\xff]/g, '**').length > 12) {
            _e = true;
            return false
        }
    });
    return !_e
}
;
$('.rrtv.media-form .form').form({
    fields: {
        name: {
            identifier: 'name',
            rules: [{
                type: 'empty',
                prompt: '请填写标题。'
            }, {
                type: 'maxByte[50]',
                prompt: '超过25个字符的限制。'
            }]
        },
        category: {
            identifier: 'category',
            rules: [{
                type: 'empty',
                prompt: '请选择视频分类。'
            }]
        },
        cover: {
            identifier: 'cover',
            rules: [{
                type: 'empty',
                prompt: '请上传横版封面图片。推荐大小(600px * 339px)。'
            }]
        },
        vertical_cover: {
            identifier: 'vertical_cover',
            rules: [{
                type: 'empty',
                prompt: '请上传竖版封面图片。推荐大小(500px * 690px)。'
            }]
        },
        sub_category: {
            identifier: 'sub_category',
            rules: [{
                type: 'empty',
                prompt: '请选择视频二级分类。'
            }]
        },
        description: {
            identifier: 'description',
            rules: [{
                type: 'maxByte[500]',
                prompt: '超过250个字符的限制。'
            }, {
                type: 'empty',
                prompt: '请填写视频简介。'
            }]
        },
        tags: {
            identifier: 'tags',
            rules: [{
                type: 'empty',
                prompt: '请填写标签并按回车分隔。'
            }, {
                type: 'maxCount[10]',
                prompt: '不能超过10个标签。'
            }, {
                type: 'youkuTagLength',
                prompt: '单个标签长度在1到6个字之间。'
            }]
        }
    },
    inline: true,
    on: 'blur',
    transition: 'fade',
    selector: {
        prompt: '.error-msg'
    },
    onSuccess: function(event, fields) {
        $(this).api('set loading');
        console.log('form is valid!');
        $(this).find('.submit').api({
            action: 'rrtv submit',
            method: 'POST',
            on: 'now',
            serializeForm: true,
            onSuccess: function(response) {
                console.log('rrtv form successfully submitted...');
                var id = response.data.id;
                var unsaved = $(this).parents('.unsaved');
                unsaved.find('.submit').data('id', id);
                var verbose_time = unsaved.form('get field', 'timing').val();
                var saved = unsaved.siblings('.saved');
                var cover = unsaved.form('get field', 'cover').val();
                if (cover) {
                    saved.find('.cover-preview').css('background-image', 'url("' + cover + '")').addClass('visible').removeClass('invisible');
                } else {
                    saved.find('.cover-preview').addClass('invisible').removeClass('visible');
                }
                saved.find('.v-title').text(unsaved.form('get field', 'name').val());
                if (verbose_time) {
                    saved.find('.time-left').show();
                    saved.find('.time-left .time').text(verbose_time);
                } else {
                    saved.find('.time-left').hide()
                }
                saved.closest('.media-form').find('.triangle-bottom-right').addClass('active');
                saved.closest('.media-form').find('.saved-label').addClass('active');
                saved.find('.des').text(unsaved.form('get field', 'description').val());
                saved.find('.v-category').text(unsaved.form('get field', 'category').find("option:selected").text());
                saved.find('.v-tag').remove();
                var tags = unsaved.form('get field', 'tags').val() || [];
                $.each(tags, function(index, ele) {
                    saved.find('.category-wrapper').append('<p class="v-tag"><i class="iconfont icon-biaoqian"></i>' + ele + '</p>')
                });
                unsaved.hide();
                saved.fadeIn();
                virtual_form(this)
            },
            onFailure: function(response) {
                var unsaved = $(this).parents('.unsaved').api('remove loading');
                console.log(response.message);
            },
            onError: function(errorMessage) {
                var unsaved = $(this).parents('.unsaved').api('remove loading');
                alert('错误的服务器响应。');
                console.log('onError called...');
            },
            onAbort: function(errorMessage) {
                var unsaved = $(this).parents('.unsaved').api('remove loading');
                console.log('onAbort called...');
            },
            beforeSend: function(settings) {
                var unsaved = $(this).parents('.unsaved');
                var tags = unsaved.form('get field', 'tags').val() || [];
                settings.data.tags = tags.join(',');
                console.log(settings.data);
                return settings;
            }
        })
    }
});
$('.meipai.media-form .form').form({
    fields: {
        name: {
            identifier: 'name',
            rules: [{
                type: 'maxByte[280]',
                prompt: '超过140个字符的限制。'
            }]
        },
        cover: {
            identifier: 'cover',
            rules: []
        },
    },
    inline: true,
    on: 'blur',
    transition: 'fade',
    selector: {
        prompt: '.error-msg'
    },
    onSuccess: function(event, fields) {
        $(this).api('set loading');
        console.log('form is valid!');
        $(this).find('.submit').api({
            action: 'meipai submit',
            method: 'POST',
            on: 'now',
            serializeForm: true,
            onSuccess: function(response) {
                console.log('meipai form successfully submitted...');
                var id = response.data.id;
                var unsaved = $(this).parents('.unsaved');
                unsaved.find('.submit').data('id', id);
                var topics = unsaved.form('get field', 'name').val().match(/#[^#\s]+#/g) || [];
                var verbose_time = unsaved.form('get field', 'timing').val();
                var saved = unsaved.siblings('.saved');
                var cover = unsaved.form('get field', 'cover').val();
                saved.find('.v-title').text(unsaved.form('get field', 'name').val() || '无标题视频');
                if (cover) {
                    saved.find('.cover-preview').css('background-image', 'url("' + cover + '")').addClass('visible').removeClass('invisible');
                } else {
                    saved.find('.cover-preview').addClass('invisible').removeClass('visible');
                }
                if (verbose_time) {
                    saved.find('.time-left').show();
                    saved.find('.time-left .time').text(verbose_time);
                } else {
                    saved.find('.time-left').hide()
                }
                saved.closest('.media-form').find('.triangle-bottom-right').addClass('active');
                saved.closest('.media-form').find('.saved-label').addClass('active');
                saved.find('.category-wrapper').empty();
                $.each(topics, function(index, ele) {
                    saved.find('.category-wrapper').append('<p class="v-category">' + ele + '</p>')
                });
                unsaved.hide();
                saved.fadeIn();
                virtual_form(this)
            },
            onFailure: function(response) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                alert(response.message);
                console.log(response.message);
            },
            onError: function(errorMessage) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                alert('错误的服务器响应。');
                console.log('onError called...');
                console.log(errorMessage)
            },
            onAbort: function(errorMessage) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                console.log('onAbort called...');
                console.log(errorMessage);
            }
        })
    }
});
$('.miaopai.media-form .form').form({
    fields: {
        name: {
            identifier: 'name',
            rules: [{
                type: 'maxByte[220]',
                prompt: '超过110个字符的限制。'
            }]
        },
        tags: {
            identifier: 'tags',
            rules: [{
                type: 'maxCount[10]',
                prompt: '不能超过10个标签。'
            }]
        }
    },
    inline: true,
    on: 'blur',
    transition: 'fade',
    selector: {
        prompt: '.error-msg'
    },
    onSuccess: function(event, fields) {
        $(this).api('set loading');
        console.log('form is valid!');
        $(this).find('.submit').api({
            action: 'miaopai submit',
            method: 'POST',
            on: 'now',
            serializeForm: true,
            onSuccess: function(response) {
                console.log('miaopai form successfully submitted...');
                var id = response.data.id;
                var unsaved = $(this).parents('.unsaved');
                unsaved.find('.submit').data('id', id);
                var verbose_time = unsaved.form('get field', 'timing').val();
                var saved = unsaved.siblings('.saved');
                var cover = unsaved.form('get field', 'cover').val();
                saved.find('.v-title').text(unsaved.form('get field', 'name').val() || '无标题视频');
                if (cover) {
                    saved.find('.cover-preview').css('background-image', 'url("' + cover + '")').addClass('visible').removeClass('invisible');
                } else {
                    saved.find('.cover-preview').addClass('invisible').removeClass('visible');
                }
                if (verbose_time) {
                    saved.find('.time-left').show();
                    saved.find('.time-left .time').text(verbose_time);
                } else {
                    saved.find('.time-left').hide()
                }
                saved.closest('.media-form').find('.triangle-bottom-right').addClass('active');
                saved.closest('.media-form').find('.saved-label').addClass('active');
                saved.find('.category-wrapper').empty();
                var tags = unsaved.form('get field', 'tags').val() || [];
                $.each(tags, function(index, ele) {
                    saved.find('.category-wrapper').append('<p class="v-category">#' + ele + '#</p>')
                });
                unsaved.hide();
                saved.fadeIn();
                virtual_form(this)
            },
            onFailure: function(response) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                console.log(response.message);
            },
            onError: function(errorMessage) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                alert('错误的服务器响应。');
                console.log('onError called...');
                console.log(errorMessage)
            },
            onAbort: function(errorMessage) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                console.log('onAbort called...');
                console.log(errorMessage);
            },
            beforeSend: function(settings) {
                var unsaved = $(this).parents('.unsaved');
                var tags = unsaved.form('get field', 'tags').val() || [];
                settings.data.tags = tags.join(',');
                console.log(settings.data);
                return settings;
            }
        })
    }
});
$('.youku.media-form .form').form({
    fields: {
        account: {
            identifier: 'expired',
            rules: [{
                type: 'not[expired]',
                prompt: '该账号七日内授权将过期，请<a href="/youku/auth/go/" class="refresh">更新授权</a>。'
            }]
        },
        name: {
            identifier: 'name',
            rules: [{
                type: 'empty',
                prompt: '请填写标题。'
            }, {
                type: 'maxByte[160]',
                prompt: '超过80个字符的限制。'
            }]
        },
        description: {
            identifier: 'description',
            rules: [{
                type: 'maxByte[4000]',
                prompt: '超过2000个字符的限制。'
            }]
        },
        category: {
            identifier: 'category',
            rules: [{
                type: 'empty',
                prompt: '请选择视频分类。'
            }]
        },
        tags: {
            identifier: 'tags',
            rules: [{
                type: 'maxCount[10]',
                prompt: '不能超过10个标签。'
            }, {
                type: 'minCount[1]',
                prompt: '标签不能为空。'
            }, {
                type: 'youkuTagLength',
                prompt: '单个标签长度在1到6个字之间。'
            }]
        }
    },
    inline: true,
    on: 'blur',
    transition: 'fade',
    selector: {
        prompt: '.error-msg'
    },
    onSuccess: function(event, fields) {
        $(this).api('set loading');
        console.log('form is valid!');
        $(this).find('.submit').api({
            action: 'youku submit',
            method: 'POST',
            on: 'now',
            serializeForm: true,
            onSuccess: function(response) {
                console.log('youku form successfully submitted...');
                var id = response.data.id;
                var unsaved = $(this).parents('.unsaved');
                unsaved.find('.submit').data('id', id);
                var verbose_time = unsaved.form('get field', 'timing').val();
                var saved = unsaved.siblings('.saved');
                saved.find('.v-title').text(unsaved.form('get field', 'name').val() || '无标题视频');
                if (verbose_time) {
                    saved.find('.time-left').show();
                    saved.find('.time-left .time').text(verbose_time);
                } else {
                    saved.find('.time-left').hide()
                }
                saved.closest('.media-form').find('.triangle-bottom-right').addClass('active');
                saved.closest('.media-form').find('.saved-label').addClass('active');
                saved.find('.des').text(unsaved.form('get field', 'description').val());
                saved.find('.v-category').text(unsaved.form('get field', 'category').find("option:selected").text());
                saved.find('.v-tag').remove();
                var tags = unsaved.form('get field', 'tags').val() || [];
                $.each(tags, function(index, ele) {
                    saved.find('.category-wrapper').append('<p class="v-tag"><i class="iconfont icon-biaoqian"></i>' + ele + '</p>')
                });
                unsaved.hide();
                saved.fadeIn();
                virtual_form(this)
            },
            onFailure: function(response) {
                var unsaved = $(this).parents('.unsaved').api('remove loading');
                console.log(response.message);
            },
            onError: function(errorMessage) {
                var unsaved = $(this).parents('.unsaved').api('remove loading');
                alert('错误的服务器响应。');
                console.log('onError called...');
            },
            onAbort: function(errorMessage) {
                var unsaved = $(this).parents('.unsaved').api('remove loading');
                console.log('onAbort called...');
            },
            beforeSend: function(settings) {
                var unsaved = $(this).parents('.unsaved');
                var tags = unsaved.form('get field', 'tags').val() || [];
                settings.data.tags = tags.join(',');
                console.log(settings.data);
                return settings;
            }
        })
    }
});
$('.iqiyi.media-form .form').form({
    fields: {
        account: {
            identifier: 'expired',
            rules: [{
                type: 'not[expired]',
                prompt: '该账号七日内授权将过期，请<a href="/iqiyi/auth/go/" class="refresh">更新授权</a>。'
            }]
        },
        name: {
            identifier: 'name',
            rules: [{
                type: 'empty',
                prompt: '请填写标题。'
            }, {
                type: 'maxByte[160]',
                prompt: '超过80个字符的限制。'
            }]
        },
        description: {
            identifier: 'description',
            rules: [{
                type: 'maxByte[2000]',
                prompt: '超过1000个字符的限制。'
            }]
        },
        category: {
            identifier: 'category',
            rules: [{
                type: 'empty',
                prompt: '请选择视频分类。'
            }]
        },
        tags: {
            identifier: 'tags',
            rules: [{
                type: 'maxCount[10]',
                prompt: '不能超过10个标签。'
            }, {
                type: 'youkuTagLength',
                prompt: '单个标签长度在1到6个字之间。'
            }]
        }
    },
    inline: true,
    on: 'blur',
    transition: 'fade',
    selector: {
        prompt: '.error-msg'
    },
    onSuccess: function(event, fields) {
        $(this).api('set loading');
        console.log('form is valid!');
        $(this).find('.submit').api({
            action: 'iqiyi submit',
            method: 'POST',
            on: 'now',
            serializeForm: true,
            onSuccess: function(response) {
                console.log('iqiyi form successfully submitted...');
                var id = response.data.id;
                var unsaved = $(this).parents('.unsaved');
                unsaved.find('.submit').data('id', id);
                var verbose_time = unsaved.form('get field', 'timing').val();
                var saved = unsaved.siblings('.saved');
                saved.find('.v-title').text(unsaved.form('get field', 'name').val() || '无标题视频');
                if (verbose_time) {
                    saved.find('.time-left').show();
                    saved.find('.time-left .time').text(verbose_time);
                } else {
                    saved.find('.time-left').hide()
                }
                saved.closest('.media-form').find('.triangle-bottom-right').addClass('active');
                saved.closest('.media-form').find('.saved-label').addClass('active');
                saved.find('.des').text(unsaved.form('get field', 'description').val());
                saved.find('.v-category').text(unsaved.form('get field', 'category').find("option:selected").text());
                saved.find('.v-tag').remove();
                var tags = unsaved.form('get field', 'tags').val() || [];
                $.each(tags, function(index, ele) {
                    saved.find('.category-wrapper').append('<p class="v-tag"><i class="iconfont icon-biaoqian"></i>' + ele + '</p>')
                });
                unsaved.hide();
                saved.fadeIn();
                virtual_form(this)
            },
            onFailure: function(response) {
                var unsaved = $(this).parents('.unsaved').api('remove loading');
                console.log(response.message);
            },
            onError: function(errorMessage) {
                var unsaved = $(this).parents('.unsaved').api('remove loading');
                alert('错误的服务器响应。');
                console.log('onError called...');
            },
            onAbort: function(errorMessage) {
                var unsaved = $(this).parents('.unsaved').api('remove loading');
                console.log('onAbort called...');
            },
            beforeSend: function(settings) {
                var unsaved = $(this).parents('.unsaved');
                var tags = unsaved.form('get field', 'tags').val() || [];
                settings.data.tags = tags.join(',');
                console.log(settings.data);
                return settings;
            }
        })
    }
});
$('.tudou.media-form .form').form({
    fields: {
        account: {
            identifier: 'expired',
            rules: [{
                type: 'not[expired]',
                prompt: '该账号七日内授权将过期，请<a href="/tudou/auth/go/" class="refresh">更新授权</a>。'
            }]
        },
        name: {
            identifier: 'name',
            rules: [{
                type: 'empty',
                prompt: '请填写标题。'
            }, {
                type: 'maxByte[160]',
                prompt: '超过80个字符的限制。'
            }]
        },
        description: {
            identifier: 'description',
            rules: [{
                type: 'maxByte[4000]',
                prompt: '超过2000个字符的限制。'
            }]
        },
        category: {
            identifier: 'category',
            rules: [{
                type: 'empty',
                prompt: '请选择视频分类。'
            }]
        },
        tags: {
            identifier: 'tags',
            rules: [{
                type: 'maxCount[10]',
                prompt: '不能超过10个标签。'
            }, {
                type: 'minCount[1]',
                prompt: '标签不能为空。'
            }, {
                type: 'youkuTagLength',
                prompt: '单个标签长度在1到6个字之间。'
            }]
        }
    },
    inline: true,
    on: 'blur',
    transition: 'fade',
    selector: {
        prompt: '.error-msg'
    },
    onSuccess: function(event, fields) {
        $(this).api('set loading');
        console.log('form is valid!');
        $(this).find('.submit').api({
            action: 'tudou submit',
            method: 'POST',
            on: 'now',
            serializeForm: true,
            onSuccess: function(response) {
                console.log('tudou form successfully submitted...');
                var id = response.data.id;
                var unsaved = $(this).parent('.unsaved');
                unsaved.find('.submit').data('id', id);
                var verbose_time = unsaved.form('get field', 'timing').val();
                var saved = unsaved.siblings('.saved');
                saved.find('.v-title').text(unsaved.form('get field', 'name').val() || '无标题视频');
                if (verbose_time) {
                    saved.find('.time-left').show();
                    saved.find('.time-left .time').text(verbose_time);
                } else {
                    saved.find('.time-left').hide()
                }
                saved.closest('.media-form').find('.triangle-bottom-right').addClass('active');
                saved.closest('.media-form').find('.saved-label').addClass('active');
                saved.find('.des').text(unsaved.form('get field', 'description').val());
                saved.find('.v-category').text(unsaved.form('get field', 'category').find("option:selected").text());
                saved.find('.v-tag').remove();
                var tags = unsaved.form('get field', 'tags').val() || [];
                $.each(tags, function(index, ele) {
                    saved.find('.category-wrapper').append('<p class="v-tag"><i class="iconfont icon-biaoqian"></i>' + ele + '</p>')
                });
                unsaved.hide();
                saved.fadeIn();
                virtual_form(this)
            },
            onFailure: function(response) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                alert(response.message);
                console.log(response.message);
            },
            onError: function(errorMessage) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                alert('错误的服务器响应。');
                console.log('onError called...');
                console.log(errorMessage)
            },
            onAbort: function(errorMessage) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                console.log('onAbort called...');
                console.log(errorMessage);
            },
            beforeSend: function(settings) {
                var unsaved = $(this).parents('.unsaved');
                var tags = unsaved.form('get field', 'tags').val() || [];
                settings.data.tags = tags.join(',');
                console.log(settings.data);
                return settings;
            }
        })
    }
});
$('.cover-preview').dimmer({
    on: 'hover'
});
$('.cover-preview .dimmer').on('click', function() {
    $(this).parents('.saved').find('.bottom-btn').click();
    $(this).parents('.saved').siblings('.unsaved').find('.cover-btn').click();
});
$('.common.media-form .form').form({
    fields: {
        name: {
            identifier: 'name',
            rules: [{
                type: 'empty',
                prompt: '请填写标题。'
            }, {
                type: 'maxByte[40]',
                prompt: '超过20个字符的限制。'
            }]
        },
        description: {
            identifier: 'description',
            rules: [{
                type: 'empty',
                prompt: '请填写描述。'
            }]
        },
        tag: {
            identifier: 'tag',
            rules: [{
                type: 'maxCount[2]',
                prompt: '不能超过两个标签。'
            }]
        },
        cover: {
            identifier: 'cover',
            rules: [{
                type: 'empty',
                prompt: '请上传封面图片。'
            }, {
                type: 'fileExt',
                prompt: '请上传jpg结尾的图片。'
            }, {
                type: 'fileSize[2.5]',
                prompt: '请上传小于3MB的图片。'
            }]
        }
    },
    inline: true,
    on: 'blur',
    transition: 'fade',
    selector: {
        prompt: '.error-msg'
    },
    onSuccess: function(event, fields) {
        $(this).api('set loading');
        console.log('form is valid!');
        $('.meipai.media-form .submit').api({
            action: 'meipai submit',
            method: 'POST',
            on: 'now',
            data: {},
            onSuccess: function(response) {
                console.log('meipai form successfully submitted...');
                var cover = response.data.cover;
                var id = response.data.id;
                var unsaved = $(this).parent('.unsaved');
                unsaved.find('.submit').data('id', id);
                var saved = unsaved.siblings('.saved');
                saved.find('.v-title').text(unsaved.form('get field', 'name').val());
                saved.find('.cover-preview').css('background-image', 'url("' + cover + '")');
                saved.closest('.media-form').find('.triangle-bottom-right').addClass('active');
                saved.closest('.media-form').find('.saved-label').addClass('active');
                saved.find('.des').text(unsaved.form('get field', 'description').val());
                saved.find('.v-category').text(unsaved.form('get field', 'category').find("option:selected").text());
                saved.find('.v-tag').remove();
                var tags = unsaved.form('get field', 'tag').val() || [];
                $.each(tags, function(index, ele) {
                    saved.find('.category-wrapper').append('<p class="v-tag"><i class="iconfont icon-biaoqian"></i>' + ele + '</p>')
                });
                unsaved.hide();
                saved.fadeIn();
            },
            onFailure: function(response) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                console.log(response.message);
            },
            onError: function(errorMessage) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                alert('错误的服务器响应。请重新上传。');
                console.log('onError called...');
                console.log(errorMessage)
            },
            onAbort: function(errorMessage) {
                var unsaved = $(this).parent('.unsaved').api('remove loading');
                console.log('onAbort called...');
                console.log(errorMessage);
            }
        })
    }
});
$.fn.api.settings.api = {
    'rrtv submit': '/up/upload/rrtv/?id={/id}',
    'meipai submit': '/up/upload/meipai/?id={/id}',
    'miaopai submit': '/up/upload/miaopai/?id={/id}',
    'tudou submit': '/up/upload/tudou/?id={/id}',
    'youku submit': '/up/upload/youku/?id={/id}',
    'iqiyi submit': '/up/upload/iqiyi/?id={/id}'
};
function video_complete() {
    console.log('checking video...');
    var success = true;
    var uploaded = $('.uploading-file');
    if (!uploaded.data('vid') || !uploaded.data('key')) {
        success = false;
        $('html, body').animate({
            scrollTop: $('#upload-area').offset().top - 20
        }, 500);
        alert('还未上传视频或视频上传未完成。');
    }
    return success
}
function media_complete() {
    console.log('checking media selection...');
    var selected_num = $('.media-info.clickable.active').length;
    if (!selected_num) {
        alert('请点击头像选择视频发布账号。')
    }
    return Boolean(selected_num)
}

var data_ready = function() {
    var error = false;
    $.each($('.media-form.active .unsaved .submit'), function(i, e) {
        if (!$(e).data('id')) {
            error = true;
            return false
        }
    });
    return !error;
};
var final_save = function() {
    var vid = $('.uploading-file').data('vid');
    var queue = [];
    $.each($('.media-form.active .unsaved .submit'), function(i, e) {
        queue.push($(e).data('id'));
    });
    console.log('video queues to link: ' + queue);
    $.post('/up/save/', {
        'queue': queue.join(','),
        'v': vid
    }, function(data) {
        if (data.success) {
            is_uploading = false;
            window.location.href = '/up/video/';
        } else {
            alert('抱歉, 保存出错了!');
            $('.save-all').removeClass('loading');
        }
    });
}
$('.drop:not(.addition)').dropdown({});
$('.tag-dropdown.addition').dropdown({
    allowAdditions: true,
    selector: {
        remove: '> .label > .iconfont.icon-iconfontcha'
    },
    maxSelections: 10,
    placeholder: '每输入完一个标签请点击回车'
});
is_uploading = false;
function alert_if_uploading() {
    if (is_uploading)
        return '文件正在上传中，您确定要离开当前页面？';
}
var cate_relation = {
    '2': [{
        '15': '其他'
    }, {
        '128': '广告短片'
    }, {
        '129': '新闻'
    }, {
        '130': '脱口秀'
    }, {
        '131': '游戏'
    }],
    '3': [{
        '14': '其他'
    }, {
        '147': '预告'
    }, {
        '148': '原创/混剪'
    }, {
        '149': '访谈'
    }, {
        '150': '美漫'
    }],
    '4': [{
        '16': '其他'
    }],
    '5': [{
        '17': '其他'
    }, {
        '155': '公开课'
    }, {
        '156': '外语教学'
    }],
    '7': [{
        '18': '其他'
    }, {
        '132': '翻唱MV'
    }, {
        '133': '榜单'
    }, {
        '135': '演奏'
    }, {
        '136': '现场'
    }],
    '8': [{
        '19': '其他'
    }, {
        '151': '新科技'
    }, {
        '152': '数码'
    }, {
        '153': '机车机械'
    }, {
        '154': '科普'
    }],
    '9': [{
        '19': '其他'
    }, {
        '142': '搞笑'
    }, {
        '143': '日常'
    }, {
        '144': '美食'
    }, {
        '145': '萌宠'
    }, {
        '146': '美女'
    }],
    '10': [{
        '21': '其他'
    }, {
        '137': 'NBA'
    }, {
        '138': '足球'
    }, {
        '139': '搏击'
    }, {
        '140': '极限运动'
    }, {
        '141': '健身'
    }],
    '11': [{
        '22': '其他'
    }, {
        '157': '自然'
    }, {
        '158': '文史'
    }, {
        '159': '科教'
    }]
};
$('.rrtv.media-form .form .category-dropdown').dropdown({
    action: 'activate',
    onChange: function(value, text, $selectedItem) {
        var sub_cate = $(this).parents('.rrtv').find('[name="sub_category"]');
        sub_cate.empty();
        for (var item in cate_relation[value]) {
            for (var key in cate_relation[value][item]) {
                sub_cate.append('<option value=' + key + '>' + cate_relation[value][item][key] + '</option>')
            }
        }
        console.log(value);
        console.log(text);
    }
});
window.onbeforeunload = alert_if_uploading;
$(function() {
    String.prototype.toLeftTime = function() {
        var sec_num = parseInt(this, 10);
        var hours = Math.floor(sec_num / 3600);
        var minutes = Math.floor((sec_num - (hours * 3600)) / 60);
        var seconds = sec_num - (hours * 3600) - (minutes * 60);
        if (hours < 10) {
            hours = "0" + hours;
        }
        if (minutes < 10) {
            minutes = "0" + minutes;
        }
        if (seconds < 10) {
            seconds = "0" + seconds;
        }
        if (hours > 0) {
            return hours + '时' + minutes + '分' + seconds + '秒';
        }
        return minutes + '分' + seconds + '秒';
    }
    ;
    function get_size(size) {
        var _size = size;
        var unit = 'Byte';
        if (size > 1024) {
            _size = size / 1024;
            unit = 'KB';
        }
        if (_size > 1024) {
            _size = _size / 1024;
            unit = 'MB';
        }
        if (_size > 1024) {
            unit = 'GB';
            _size = _size / 1024;
        }
        return _size.toFixed(1) + unit
    }
    var set_upload_options = function(up, filename) {
        var url = '/up/upload/prepare/?name=' + encodeURIComponent(filename);
        $.get(url, function(data) {
            var new_multipart_params = {
                'key': data['key'],
                'policy': data['policy'],
                'OSSAccessKeyId': data['accessid'],
                'success_action_status': '200',
                'signature': data['signature'],
                'callback': data['callback'],
                'expire': parseInt(data['expire'])
            };
            up.setOption({
                'url': data['host'],
                'multipart_params': new_multipart_params
            });
            up.start()
        });
    };
    $('.stop-upload').on('click', function() {
        if (confirm("确定取消上传吗?")) {
            is_uploading = false;
            $('.upload-tip').fadeOut();
            $('.uploading-file').data('vid', '').data('key', '').hide();
            $('.empty-file').show();
            $('.loaded').width('0');
            $('.loader-dot').css('left', '0');
            $('.upload-area').find('.triangle-bottom-right, .saved-label').removeClass('active');
            uploader.stop();
            uploader.removeFile(uploader.files[0]);
            $('.content.blink').removeClass('blink');
            if (!$('.media-info.clickable.active').length) {
                $('.save-all').hide();
            }
        }
    });
    uploader = new plupload.Uploader({
        runtimes: 'html5,flash,silverlight,html4',
        browse_button: $('.up-btn')[0],
        url: 'http://koubeijie-beijing.oss-cn-beijing.aliyuncs.com',
        filters: {
            mime_types: [{
                title: "Video files",
                extensions: "mp4,mov"
            }]
        },
        init: {
            FilesAdded: function(up, files) {
                var name = files[0].name;
                console.log(name + ' has been added to the queue.');
                is_uploading = true;
                set_upload_options(up, name);
                $('.empty-file').hide();
                $('.uploading-file').show();
                $('.file-name').text(name);
                $('.meta-upload .title-size').text(get_size(files[0].size));
                $('.meta-upload-wrapper').show();
                $('.meta-upload .time-left').data('start', (new Date().getTime() / 1000).toFixed());
                $('.meta-upload .speed').data('time', (new Date().getTime() / 1000).toFixed()).data('loaded', 0);
                $('.save-all').fadeIn();
            },
            UploadProgress: function(up, file) {
                var time_left_wrapper = $('.meta-upload .time-left');
                var speed_wrapper = $('.meta-upload .speed');
                var last_refresh_time = speed_wrapper.data('time');
                var new_refresh_time = (new Date().getTime() / 1000).toFixed();
                var last_loaded = speed_wrapper.data('loaded');
                var loaded = file.loaded;
                var time_past = new_refresh_time - parseInt(last_refresh_time);
                if (time_past > 1 || file.percent == 100) {
                    speed_wrapper.data('time', new_refresh_time);
                    var new_loaded = loaded - last_loaded;
                    var speed = get_size(new_loaded / time_past) + '/秒';
                    speed_wrapper.data('loaded', loaded);
                    speed_wrapper.text(speed);
                    var left_seconds = (parseInt((new Date().getTime() / 1000).toFixed()) - parseInt(time_left_wrapper.data('start'))) * (100 - file.percent) / file.percent;
                    var left_time = String(left_seconds).toLeftTime();
                    time_left_wrapper.text(left_time);
                    $('.meta-upload .uploaded-size').text(get_size(loaded));
                    $('.percentage .percent').text(file.percent + '%');
                    $('.loaded').width(file.percent + '%');
                    $('.loader-dot').css('left', file.percent + '%');
                    if (file.percent == 100) {
                        $('.meta-upload-wrapper').hide();
                        $('.upload-tip').fadeIn().text('正在分析视频...请稍候...');
                    }
                    console.log('uploading: ' + file.percent + '%...')
                }
            },
            FileUploaded: function(up, file, info) {
                console.log('video uploaded status: ' + info.status);
                is_uploading = false;
                var response = {};
                try {
                    console.log($.parseJSON(info.response));
                    response = $.parseJSON(info.response);
                } catch (err) {
                    response = {
                        "success": false,
                        "error": '服务器错误'
                    }
                }
                if (response['success']) {
                    var url = '/up/update/set_upload_cookie/';
                    var post_data = {
                        'vid': response['vid'],
                        'key': response['key'],
                        'csrfmiddlewaretoken': 'LweVmIRi58E3glqNDhSkvr8rPTLVOcRR'
                    };
                    $.post(url, data = post_data, function() {});
                    $('.upload-tip').show().text('上传完成！请选择发布账号。');
                    $('.upload-area').find('.triangle-bottom-right, .saved-label').addClass('active');
                    $('.uploading-file').data('vid', response['vid']).data('key', response['key']);
                    setTimeout("if (!$('.media-info.clickable.active').length) {$('#select-account').addClass('blink')}", 5000)
                } else {
                    $('.upload-tip').show().text('上传失败。请重试或联系客服。');
                }
            },
            Error: function(up, err) {
                console.log(up);
                is_uploading = false;
                alert('由于网络原因上传终止。');
                $('.empty-file').show();
                $('.uploading-file').hide();
                up.stop();
                up.removeFile(up.files[0]);
                console.log(err.response);
            }
        }
    });
    uploader.init();
});
var all_accounts = $('.all-accounts');
$('#choose-channel').dropdown();
var choose_channel = function(btn, name, show_values) {
    if (name == 'all') {
        all_accounts.find('.account').show().find('.media-info.active').click();
        all_accounts.find('.account .media-info').click()
        console.log("click");

    } else {
        all_accounts.find('.account').show();
        $('.media-info.clickable.active').click();

        all_accounts.find('.account .media-info').each(function(index, ele) {
            console.log(index+ele);


            if (show_values.indexOf($(ele).data('mid')) >= 0) {
                $(ele).click()
            } else {
                if ($(ele).hasClass('active')) {
                    $(ele).click()
                }
                $(ele).parents('.account').hide()
            }
        })
    }
}
